[PATCH] RDMA/nldev: Add missing break in rdma_nl_notify_err_msg()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: 9cbed5aab5ae ("RDMA/nldev: Add support for RDMA monitoring")
Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
---
 drivers/infiniband/core/nldev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 10b1411ac53d8e9c89b6705659e772eb84f4c923..39f89a4b86498220ec30bcb16bcc804f2b049752 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -2792,6 +2792,7 @@ static void rdma_nl_notify_err_msg(struct ib_device *device, u32 port_num,
 		dev_warn_ratelimited(&device->dev,
 				     "Failed to send RDMA monitor netdev detach event: port %d\n",
 				     port_num);
+		break;
 	default:
 		break;
 	}

---
base-commit: e766e6a92410ca269161de059fff0843b8ddd65f
change-id: 20240916-rdma-fix-clang-fallthrough-nl_notify_err_msg-794f75001728

Best regards,
-- 
Nathan Chancellor <nathan@xxxxxxxxxx>





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux