RE: [Intel-wired-lan] [PATCH] ice: Fix clang -Wimplicit-fallthrough in ice_pull_qvec_from_rc()

From: G, GurucharanX
Date: Thu Oct 21 2021 - 07:45:35 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
> Nathan Chancellor
> Sent: Tuesday, October 19, 2021 7:12 AM
> To: Brandeburg, Jesse <jesse.brandeburg@xxxxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>; Jakub
> Kicinski <kuba@xxxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; llvm@xxxxxxxxxxxxxxx; Nick Desaulniers
> <ndesaulniers@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; Nathan Chancellor
> <nathan@xxxxxxxxxx>; intel-wired-lan@xxxxxxxxxxxxxxxx
> Subject: [Intel-wired-lan] [PATCH] ice: Fix clang -Wimplicit-fallthrough in
> ice_pull_qvec_from_rc()
>
> 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@xxxxxxxxxx>
> ---
> drivers/net/ethernet/intel/ice/ice_lib.c | 1 +
> 1 file changed, 1 insertion(+)
>

Tested-by: Gurucharan G <gurucharanx.g@xxxxxxxxx> (A Contingent worker at Intel)