lkml.org 
[lkml]   [2015]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] net: ll_temac: Use one return statement instead of two
From
Date
On Mon, 2015-05-11 at 17:48 +0200, Julia Lawall wrote:
> > > A coccinelle script might be rather more complicated
> > > than the simpler grep above, but perhaps the script
> > > could be a bit more complete as it could likely look
> > > at more code indentation styles.
> >
> > Julia: Any comment?
>
> Here is what I had in mind:
>
> if (...) {
> ... when != goto l;
> return C;
> }
> return C;
>
> C is a constant, to avoid that its value depends on the code in the ...

Sure but I think that would miss several instances like:

switch (<foo>) {
...
default:
return <bar>;
}
return <bar>;

or the similar

if (foo) {
if (qux)
return <bar>;
} else {
return <baz>;
}

return <baz>;




\
 
 \ /
  Last update: 2015-05-11 18:21    [W:0.069 / U:2.112 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site