Skip to contentSkip to conversation

RDMA/irdma: Fix warning in utils.c build

PATCH New Jack Vogel 1 participant 1 message Feb 1, 2023

Subsystems (2)
lore
Share & tools
lore

Jack Vogel

author
#0 lore raw

PATCH 1/1 RDMA/irdma: Fix warning in utils.c build

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.

---
 drivers/infiniband/hw/irdma/utils.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/infiniband/hw/irdma/utils.c +3 -4
index 445e69e86409..fe6dd59fcf5b 100644
@@ -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;
Signature · 1 line
2.39.1