]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/bnxt_re: Use macro instead of hard coded value
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Fri, 4 Jul 2025 04:38:57 +0000 (10:08 +0530)
committerLeon Romanovsky <leon@kernel.org>
Mon, 7 Jul 2025 05:37:35 +0000 (01:37 -0400)
1. Defined a macro for the hard coded value.
2. "access" field in the request structure is of type "u8".
   Updated the mask accordingly.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Shravya KN <shravya.k-n@broadcom.com>
Link: https://patch.msgid.link/20250704043857.19158-4-kalesh-anakkur.purayil@broadcom.com
Reviewed-by: Hongguang Gao <hongguang.gao@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/bnxt_re/qplib_sp.c
drivers/infiniband/hw/bnxt_re/qplib_sp.h

index 9efd32a3dc55f58e5285a8a44dbfa8deb112ac17..68981399598d8d6b9732043467b5d89e2110fa19 100644 (file)
@@ -674,7 +674,7 @@ int bnxt_qplib_reg_mr(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr,
        req.log2_pbl_pg_size = cpu_to_le16(((ilog2(PAGE_SIZE) <<
                                 CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT) &
                                CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK));
-       req.access = (mr->access_flags & 0xFFFF);
+       req.access = (mr->access_flags & BNXT_QPLIB_MR_ACCESS_MASK);
        req.va = cpu_to_le64(mr->va);
        req.key = cpu_to_le32(mr->lkey);
        if (_is_alloc_mr_unified(res->dattr->dev_cap_flags))
index e626b05038a169ef6b87af2a0fc4f64cdffc2a60..09faf4a1e849cd0ef403164384e446468c4819e5 100644 (file)
@@ -111,6 +111,7 @@ struct bnxt_qplib_mrw {
        struct bnxt_qplib_pd            *pd;
        int                             type;
        u32                             access_flags;
+#define BNXT_QPLIB_MR_ACCESS_MASK      0xFF
 #define BNXT_QPLIB_FR_PMR              0x80000000
        u32                             lkey;
        u32                             rkey;