]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
RDMA/efa: Remove possible negative shift
authorMichael Margolin <mrgolin@amazon.com>
Wed, 10 Dec 2025 17:36:56 +0000 (17:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:58 +0000 (13:09 +0100)
[ Upstream commit 85463eb6a46caf2f1e0e1a6d0731f2f3bab17780 ]

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.

Fixes: 40909f664d27 ("RDMA/efa: Add EFA verbs implementation")
Link: https://patch.msgid.link/r/20251210173656.8180-1-mrgolin@amazon.com
Reviewed-by: Tom Sela <tomsela@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Gal Pressman <gal.pressman@linux.dev>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/efa/efa_verbs.c

index 1aab6c3e9f539819d829e550b596c870c84c3116..6fca145f1e8a1dd6375622b0b0c1cdfe75f58c06 100644 (file)
@@ -1151,13 +1151,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);