lkml.org 
[lkml]   [2019]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next] intel: Mark expected switch fall-throughs
From
Date
On Wed, 2019-01-23 at 11:11 -0600, Gustavo A. R. Silva wrote:
> Hi Jeffrey,
>
> On 1/23/19 11:04 AM, Jeff Kirsher wrote:
> > On Wed, 2019-01-23 at 01:48 -0600, Gustavo A. R. Silva wrote:
> > > In preparation to enabling -Wimplicit-fallthrough, mark switch
> > > cases
> > > where we are expecting to fall through.
> > >
> > > This patch fixes the following warnings:
> > >
> > > drivers/net/ethernet/intel/igb/e1000_82575.c:636:6: warning: this
> > > statement may fall through [-Wimplicit-fallthrough=]
> > > drivers/net/ethernet/intel/igb/igb_main.c:6710:6: warning: this
> > > statement may fall through [-Wimplicit-fallthrough=]
> > > drivers/net/ethernet/intel/i40e/i40e_xsk.c:237:3: warning: this
> > > statement may fall through [-Wimplicit-fallthrough=]
> > >
> > > Warning level 3 was used: -Wimplicit-fallthrough=3
> > >
> > > This patch is part of the ongoing efforts to enabling
> > > -Wimplicit-fallthrough.
> > >
> > > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> > > ---
> > > drivers/net/ethernet/intel/i40e/i40e_xsk.c | 3 ++-
> > > drivers/net/ethernet/intel/igb/e1000_82575.c | 2 +-
> > > drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
> > > 3 files changed, 4 insertions(+), 3 deletions(-)
> >
> > NAK on the igb changes. There is already a "fall through" code
> > comment
> > which is fine, adding a hyphen does not make the comment any more
> > readable.
> >
>
> Those comments are not fine. They trigger the warnings I mention in
> the
> commit log. With this patch such warnings are fixed.
>
> Notice that warning level 3 was used: -Wimplicit-fallthrough=3

This is a "false positive" based on the compiler option definition:

-Wimplicit-fallthrough=3 case sensitively matches a wide range of
regular expressions, listed in the GCC manual. E.g., all of these are
accepted:
/* Falls through. */
/* fall-thru */
/* Else falls through. */
/* FALLTHRU */
/* … falls through … */
etc.

You should be looking to fix the problem with the compiler option,
which is reporting "acceptable" code comments.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-01-23 18:44    [W:0.039 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site