Skip to content

Commit eb5c746

Browse files
arndbrleon
authored andcommitted
RDMA/srpt: fix function pointer cast warnings
clang-16 notices that srpt_qp_event() gets called through an incompatible pointer here: drivers/infiniband/ulp/srpt/ib_srpt.c:1815:5: error: cast from 'void (*)(struct ib_event *, struct srpt_rdma_ch *)' to 'void (*)(struct ib_event *, void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 1815 | = (void(*)(struct ib_event *, void*))srpt_qp_event; Change srpt_qp_event() to use the correct prototype and adjust the argument inside of it. Fixes: a42d985 ("ib_srpt: Initial SRP Target merge for v3.3-rc1") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 5ba4e6d commit eb5c746

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/infiniband/ulp/srpt/ib_srpt.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,12 @@ static const char *get_ch_state_name(enum rdma_ch_state s)
214214
/**
215215
* srpt_qp_event - QP event callback function
216216
* @event: Description of the event that occurred.
217-
* @ch: SRPT RDMA channel.
217+
* @ptr: SRPT RDMA channel.
218218
*/
219-
static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch)
219+
static void srpt_qp_event(struct ib_event *event, void *ptr)
220220
{
221+
struct srpt_rdma_ch *ch = ptr;
222+
221223
pr_debug("QP event %d on ch=%p sess_name=%s-%d state=%s\n",
222224
event->event, ch, ch->sess_name, ch->qp->qp_num,
223225
get_ch_state_name(ch->state));
@@ -1811,8 +1813,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
18111813
ch->cq_size = ch->rq_size + sq_size;
18121814

18131815
qp_init->qp_context = (void *)ch;
1814-
qp_init->event_handler
1815-
= (void(*)(struct ib_event *, void*))srpt_qp_event;
1816+
qp_init->event_handler = srpt_qp_event;
18161817
qp_init->send_cq = ch->cq;
18171818
qp_init->recv_cq = ch->cq;
18181819
qp_init->sq_sig_type = IB_SIGNAL_REQ_WR;

0 commit comments

Comments
 (0)