public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] ice: Fix clang -Wimplicit-fallthrough in ice_pull_qvec_from_rc()
@ 2021-10-19  1:42 Nathan Chancellor
  2021-10-19 15:32 ` Jesse Brandeburg
  2021-10-21 11:45 ` [Intel-wired-lan] " G, GurucharanX
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2021-10-19  1:42 UTC (permalink / raw)
  To: Jesse Brandeburg, Tony Nguyen, David S. Miller, Jakub Kicinski
  Cc: Nick Desaulniers, intel-wired-lan, netdev, linux-kernel, llvm,
	Nathan Chancellor

Clang warns:

drivers/net/ethernet/intel/ice/ice_lib.c:1906:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
        default:
        ^
drivers/net/ethernet/intel/ice/ice_lib.c:1906:2: note: insert 'break;' to avoid fall-through
        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.

Link: https://github.com/ClangBuiltLinux/linux/issues/1482
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/net/ethernet/intel/ice/ice_lib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index f981e77f72ad..03443c060507 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -1903,6 +1903,7 @@ static struct ice_q_vector *ice_pull_qvec_from_rc(struct ice_ring_container *rc)
 	case ICE_TX_CONTAINER:
 		if (rc->tx_ring)
 			return rc->tx_ring->q_vector;
+		break;
 	default:
 		break;
 	}

base-commit: 939a6567f976efb8b3e6d601ce35eb56b17babd0
-- 
2.33.1.637.gf443b226ca


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-21 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-19  1:42 [PATCH] ice: Fix clang -Wimplicit-fallthrough in ice_pull_qvec_from_rc() Nathan Chancellor
2021-10-19 15:32 ` Jesse Brandeburg
2021-10-21 11:45 ` [Intel-wired-lan] " G, GurucharanX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox