Skip to content

Commit 7acad3c

Browse files
nathanchancerleon
authored andcommitted
RDMA/nldev: Add missing break in rdma_nl_notify_err_msg()
Clang warns (or errors with CONFIG_WERROR=y): drivers/infiniband/core/nldev.c:2795:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] 2795 | default: | ^ 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. Fixes: 9cbed5a ("RDMA/nldev: Add support for RDMA monitoring") Signed-off-by: Nathan Chancellor <[email protected]> Link: https://patch.msgid.link/20240916-rdma-fix-clang-fallthrough-nl_notify_err_msg-v1-1-89de6a7423f1@kernel.org Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 9f0eafe commit 7acad3c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/infiniband/core/nldev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2792,6 +2792,7 @@ static void rdma_nl_notify_err_msg(struct ib_device *device, u32 port_num,
27922792
dev_warn_ratelimited(&device->dev,
27932793
"Failed to send RDMA monitor netdev detach event: port %d\n",
27942794
port_num);
2795+
break;
27952796
default:
27962797
break;
27972798
}

0 commit comments

Comments
 (0)