From: Joe Perches <joe@perches.com>
To: Yuval Mintz <yuvalmin@broadcom.com>
Cc: Ariel Elior <ariele@broadcom.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: bnx2x_sriov.c: Missing switch/case breaks?
Date: Sat, 14 Dec 2013 09:49:59 -0800 [thread overview]
Message-ID: <1387043399.2276.12.camel@joe-AO722> (raw)
In-Reply-To: <979A8436335E3744ADCD3A9F2A2B68A52AF1A7FF@SJEXCHMB10.corp.ad.broadcom.com>
On Sat, 2013-12-14 at 13:26 +0000, Yuval Mintz wrote:
> > > The `vfop' part of the code contains a lot of usage of the
> > `bnx2x_vfop_finalize()',
> > > which either goto or return at the end of almost every case.
> > > "Normal" analysis tools/scripts fail to recognize them as valid case
> > breaks.
> > >
> > > Adding `fallthrough' comments would make little sense, as this is not the
> > real
> > > behavior; Perhaps we need some alternative comment? (something in the
> > line
> > > of `macro case break')
> >
> > No idea. It's certainly an ugly macro.
> >
>
> True.
[]
> > maybe there should be a break after most all
> > uses of this macro anyway. When next is
>
> Won't some static code analysis tools regard such `break' calls as
> unreachable code?
I suppose that maybe true,
but this could also work...
bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT);
/* Ugly goto|return macro, not fall-through */
;)
prev parent reply other threads:[~2013-12-14 17:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 23:01 bnx2x_sriov.c: Missing switch/case breaks? Joe Perches
2013-12-14 6:16 ` Yuval Mintz
2013-12-14 6:57 ` Joe Perches
2013-12-14 13:26 ` Yuval Mintz
2013-12-14 17:49 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387043399.2276.12.camel@joe-AO722 \
--to=joe@perches.com \
--cc=ariele@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yuvalmin@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).