[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1387043399.2276.12.camel@joe-AO722>
Date: Sat, 14 Dec 2013 09:49:59 -0800
From: Joe Perches <joe@...ches.com>
To: Yuval Mintz <yuvalmin@...adcom.com>
Cc: Ariel Elior <ariele@...adcom.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: bnx2x_sriov.c: Missing switch/case breaks?
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 */
;)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists