diff mbox series

RDMA/irdma: Fix warning in utils.c build

Message ID 20230201024921.122711-1-jack.vogel@oracle.com (mailing list archive)
State Rejected
Headers show
Series RDMA/irdma: Fix warning in utils.c build | expand

Commit Message

Jack Vogel Feb. 1, 2023, 2:49 a.m. UTC
When defining CONFIG_INIT_STACK_ALL_ZERO a warning is emitted
due to this variable in the switch, moving it into the case 
solves the problem.

Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
---
 drivers/infiniband/hw/irdma/utils.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/irdma/utils.c b/drivers/infiniband/hw/irdma/utils.c
index 445e69e86409..fe6dd59fcf5b 100644
--- a/drivers/infiniband/hw/irdma/utils.c
+++ b/drivers/infiniband/hw/irdma/utils.c
@@ -1218,12 +1218,11 @@  int irdma_hw_modify_qp(struct irdma_device *iwdev, struct irdma_qp *iwqp,
 			return status;
 
 		switch (m_info->next_iwarp_state) {
-			struct irdma_gen_ae_info ae_info;
-
 		case IRDMA_QP_STATE_RTS:
 		case IRDMA_QP_STATE_IDLE:
 		case IRDMA_QP_STATE_TERMINATE:
-		case IRDMA_QP_STATE_CLOSING:
+		case IRDMA_QP_STATE_CLOSING: {
+			struct irdma_gen_ae_info ae_info;
 			if (info->curr_iwarp_state == IRDMA_QP_STATE_IDLE)
 				irdma_send_reset(iwqp->cm_node);
 			else
@@ -1250,7 +1249,7 @@  int irdma_hw_modify_qp(struct irdma_device *iwdev, struct irdma_qp *iwqp,
 				irdma_handle_cqp_op(rf, cqp_request);
 				irdma_put_cqp_request(&rf->cqp, cqp_request);
 			}
-			break;
+		} break;
 		case IRDMA_QP_STATE_ERROR:
 		default:
 			break;