diff mbox series

[for-next,1/5] RDMA/efa: Use offset_in_page() function

Message ID 20240624160918.27060-2-mrgolin@amazon.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series RDMA/efa: Cleanups and minor improvements | expand

Commit Message

Michael Margolin June 24, 2024, 4:09 p.m. UTC
From: Gal Pressman <galpress@amazon.com>

Use offset_in_page() instead of open-coding it.

Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Reviewed-by: Firas Jahjah <firasj@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Michael Margolin <mrgolin@amazon.com>
---
 drivers/infiniband/hw/efa/efa_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gal Pressman June 25, 2024, 6:32 a.m. UTC | #1
On 24/06/2024 19:09, Michael Margolin wrote:
> From: Gal Pressman <galpress@amazon.com>
> 
> Use offset_in_page() instead of open-coding it.
> 
> Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
> Reviewed-by: Firas Jahjah <firasj@amazon.com>
> Signed-off-by: Gal Pressman <galpress@amazon.com>
> Signed-off-by: Michael Margolin <mrgolin@amazon.com>

Looks good Gal!
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index 8f7a13b79cdc..eee2ae215414 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -524,7 +524,7 @@  static int qp_mmap_entries_setup(struct efa_qp *qp,
 
 	address = dev->mem_bar_addr + resp->llq_desc_offset;
 	length = PAGE_ALIGN(params->sq_ring_size_in_bytes +
-			    (resp->llq_desc_offset & ~PAGE_MASK));
+			    offset_in_page(resp->llq_desc_offset));
 
 	qp->llq_desc_mmap_entry =
 		efa_user_mmap_entry_insert(&ucontext->ibucontext,