Skip to content

Commit 147394d

Browse files
rleonjgunthorpe
authored andcommitted
RDMA/bnxt_re: Initialize opcode while sending message
Fix compilation warning: drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:325:18: error: variable 'opcode' is uninitialized when used here [-Werror,-Wuninitialized] crsqe->opcode = opcode; ^~~~~~ drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:291:11: note: initialize the variable 'opcode' to silence this warning u8 opcode; ^ = '\0' Fixes: bcfee4c ("RDMA/bnxt_re: remove redundant cmdq_bitmap") Link: https://lore.kernel.org/r/6ad1e44be2b560986da6fdc6b68da606413e9026.1686644105.git.leonro@nvidia.com Acked-by: Selvin Xavier <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 6735041 commit 147394d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/infiniband/hw/bnxt_re/qplib_rcfw.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static void __send_message_no_waiter(struct bnxt_qplib_rcfw *rcfw,
274274
}
275275

276276
static int __send_message(struct bnxt_qplib_rcfw *rcfw,
277-
struct bnxt_qplib_cmdqmsg *msg)
277+
struct bnxt_qplib_cmdqmsg *msg, u8 opcode)
278278
{
279279
u32 bsize, free_slots, required_slots;
280280
struct bnxt_qplib_cmdq_ctx *cmdq;
@@ -285,7 +285,6 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw,
285285
struct pci_dev *pdev;
286286
unsigned long flags;
287287
u16 cookie;
288-
u8 opcode;
289288
u8 *preq;
290289

291290
cmdq = &rcfw->cmdq;
@@ -490,7 +489,7 @@ static int __bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw,
490489
if (rc)
491490
return rc == -ENXIO ? bnxt_qplib_map_rc(opcode) : rc;
492491

493-
rc = __send_message(rcfw, msg);
492+
rc = __send_message(rcfw, msg, opcode);
494493
if (rc)
495494
return rc;
496495

0 commit comments

Comments
 (0)