From: Kalesh AP Date: Fri, 4 Jul 2025 04:38:57 +0000 (+0530) Subject: RDMA/bnxt_re: Use macro instead of hard coded value X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7788278ff267f831bab39a377beaa7e08d79c2a9;p=thirdparty%2Flinux.git RDMA/bnxt_re: Use macro instead of hard coded value 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 Signed-off-by: Shravya KN Link: https://patch.msgid.link/20250704043857.19158-4-kalesh-anakkur.purayil@broadcom.com Reviewed-by: Hongguang Gao Signed-off-by: Leon Romanovsky --- diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c index 9efd32a3dc55f..68981399598d8 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -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)) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.h b/drivers/infiniband/hw/bnxt_re/qplib_sp.h index e626b05038a16..09faf4a1e849c 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.h @@ -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;