diff mbox

[rdma-core,2/6] hns: Fix strange placement of fprintf:

Message ID 1485896886-23517-3-git-send-email-jgunthorpe@obsidianresearch.com (mailing list archive)
State Accepted
Headers show

Commit Message

Jason Gunthorpe Jan. 31, 2017, 9:08 p.m. UTC
gcc 7.0.1 observes:

providers/hns/hns_roce_u_hw_v1.c:121:3: warning: statement will never be executed [-Wswitch-unreachable]
   fprintf(stderr, PFX "error cqe!\n");

Due to the strange placement in the switch statement.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 providers/hns/hns_roce_u_hw_v1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/providers/hns/hns_roce_u_hw_v1.c b/providers/hns/hns_roce_u_hw_v1.c
index ff39593e8740f8..263502d4a85610 100644
--- a/providers/hns/hns_roce_u_hw_v1.c
+++ b/providers/hns/hns_roce_u_hw_v1.c
@@ -114,11 +114,11 @@  static void hns_roce_update_cq_cons_index(struct hns_roce_context *ctx,
 static void hns_roce_handle_error_cqe(struct hns_roce_cqe *cqe,
 				      struct ibv_wc *wc)
 {
+	fprintf(stderr, PFX "error cqe!\n");
 	switch (roce_get_field(cqe->cqe_byte_4,
 			       CQE_BYTE_4_STATUS_OF_THE_OPERATION_M,
 			       CQE_BYTE_4_STATUS_OF_THE_OPERATION_S) &
 		HNS_ROCE_CQE_STATUS_MASK) {
-		fprintf(stderr, PFX "error cqe!\n");
 	case HNS_ROCE_CQE_SYNDROME_LOCAL_LENGTH_ERR:
 		wc->status = IBV_WC_LOC_LEN_ERR;
 		break;