Skip to content

Commit 9040c0d

Browse files
nathanchancerleon
authored andcommitted
RDMA/bnxt_re: Fix clang -Wimplicit-fallthrough in bnxt_re_handle_cq_async_error()
Clang warns (or errors with CONFIG_WERROR=y): drivers/infiniband/hw/bnxt_re/main.c:1114:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] 1114 | default: | ^ drivers/infiniband/hw/bnxt_re/main.c:1114:2: note: insert 'break;' to avoid fall-through 1114 | default: | ^ | break; 1 error generated. Clang is a little more pedantic than GCC, which does not warn when falling through to a case that is just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst, which states that all switch/case blocks must end in either break, fallthrough, continue, goto, or return. Add the missing break to silence the warning. Closes: ClangBuiltLinux#1950 Fixes: b02fd3f ("RDMA/bnxt_re: Report async events and errors") Signed-off-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/20231020-bnxt_re-implicit-fallthrough-v1-1-b5c19534a6c9@kernel.org Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 07f06e0 commit 9040c0d

File tree

1 file changed

+1
-0
lines changed
  • drivers/infiniband/hw/bnxt_re

1 file changed

+1
-0
lines changed

drivers/infiniband/hw/bnxt_re/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,7 @@ static int bnxt_re_handle_cq_async_error(void *event, struct bnxt_re_cq *cq)
11111111
case CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_OVERFLOW_ERROR:
11121112
case CREQ_CQ_ERROR_NOTIFICATION_CQ_ERR_REASON_RES_CQ_LOAD_ERROR:
11131113
ibevent.event = IB_EVENT_CQ_ERR;
1114+
break;
11141115
default:
11151116
break;
11161117
}

0 commit comments

Comments
 (0)