lkml.org 
[lkml]   [2013]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: bnx2x_sriov.c: Missing switch/case breaks?
From
Date
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 */

;)




\
 
 \ /
  Last update: 2013-12-14 19:21    [W:0.045 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site