Skip to contentSkip to conversation

RDMA/efa: Remove possible negative shift

PATCH In review Michael Margolin 3 participants 3 messages Dec 10, 2025 – Dec 17, 2025

Subsystems (2)
lore
Share & tools
lore

Michael Margolin

author maintainer
#0 lore raw

PATCH 1/1 RDMA/efa: Remove possible negative shift

The page size used for device might in some cases be smaller than PAGE_SIZE what results in a negative shift when calculating the number of host pages in PAGE_SIZE for a debug log. Remove the debug line together with the calculation.

---
 drivers/infiniband/hw/efa/efa_verbs.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/infiniband/hw/efa/efa_verbs.c +0 -4
index 22d3e25c3b9d..755bba8d58bb 100644
@@ -1320,13 +1320,9 @@ static int umem_to_page_list(struct efa_dev *dev,
 			     u32 hp_cnt,
 			     u8 hp_shift)
 {
-	u32 pages_in_hp = BIT(hp_shift - PAGE_SHIFT);
 	struct ib_block_iter biter;
 	unsigned int hp_idx = 0;
 
-	ibdev_dbg(&dev->ibdev, "hp_cnt[%u], pages_in_hp[%u]\n",
-		  hp_cnt, pages_in_hp);
-
 	rdma_umem_for_each_dma_block(umem, &biter, BIT(hp_shift))
 		page_list[hp_idx++] = rdma_block_iter_dma_address(&biter);
 
Signature · 1 line
2.47.3
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Michael Margolin

The page size used for device might in some cases be smaller than PAGE_SIZE what results in a negative shift when calculating the number of host pages in PAGE_SIZE for a debug log. Remove the debug line together with the calculation.

I don't know if you target this to -rc or -next, but this probably deserves a Fixes tag.

maintainer
#2 lore raw
In reply to Michael Margolin
Quoted 5 lines · Michael Margolin

The page size used for device might in some cases be smaller than PAGE_SIZE what results in a negative shift when calculating the number of host pages in PAGE_SIZE for a debug log. Remove the debug line together with the calculation.

Quoted 7 lines
---
 drivers/infiniband/hw/efa/efa_verbs.c | 4 ----
 1 file changed, 4 deletions(-)

I added

Fixes 40909f664d27 ("RDMA/efa: Add EFA verbs implementation")

Jason