[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <12e0fb52-9853-7115-9699-176de053c641@intel.com>
Date: Tue, 19 Oct 2021 08:32:31 -0700
From: Jesse Brandeburg <jesse.brandeburg@...el.com>
To: Nathan Chancellor <nathan@...nel.org>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
"David S. Miller" <davem@...emloft.net>,
"Jakub Kicinski" <kuba@...nel.org>
CC: Nick Desaulniers <ndesaulniers@...gle.com>,
<intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <llvm@...ts.linux.dev>
Subject: Re: [PATCH] ice: Fix clang -Wimplicit-fallthrough in
ice_pull_qvec_from_rc()
On 10/18/2021 6:42 PM, Nathan Chancellor wrote:
> 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@...nel.org>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@...el.com>
Powered by blists - more mailing lists