]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/core: Convert to use ERR_CAST()
authorLi Haoran <li.haoran7@zte.com.cn>
Tue, 1 Apr 2025 13:08:40 +0000 (21:08 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 7 Apr 2025 18:12:06 +0000 (15:12 -0300)
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 <li.haoran7@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/mad_rmpp.c

index 8af0619a39cda6fc28bf05eec1e97d3c7d2a0f1f..b4b10e8a64950f0c3ce815c171daa610219e3ced 100644 (file)
@@ -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,