From: Li Haoran
Date: Tue, 1 Apr 2025 13:08:40 +0000 (+0800)
Subject: RDMA/core: Convert to use ERR_CAST()
X-Git-Tag: v6.16-rc1~111^2~57
X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41e2649c796e1f49c7b4d9176d2437504b78580f;p=thirdparty%2Flinux.git
RDMA/core: Convert to use ERR_CAST()
As opposed to open-code, using the ERR_CAST macro clearly indicates that
this is a pointer to an error value and a type conversion was performed.
Link: https://patch.msgid.link/r/20250401210840146_IyrV3zlejzz3eAnDmMSB@zte.com.cn
Signed-off-by: Li Haoran
Signed-off-by: Shao Mingyin
Signed-off-by: Jason Gunthorpe
---
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c
index 8af0619a39cda..b4b10e8a64950 100644
--- a/drivers/infiniband/core/mad_rmpp.c
+++ b/drivers/infiniband/core/mad_rmpp.c
@@ -158,7 +158,7 @@ static struct ib_mad_send_buf *alloc_response_msg(struct ib_mad_agent *agent,
ah = ib_create_ah_from_wc(agent->qp->pd, recv_wc->wc,
recv_wc->recv_buf.grh, agent->port_num);
if (IS_ERR(ah))
- return (void *) ah;
+ return ERR_CAST(ah);
hdr_len = ib_get_mad_data_offset(recv_wc->recv_buf.mad->mad_hdr.mgmt_class);
msg = ib_create_send_mad(agent, recv_wc->wc->src_qp,