[Cocci] coccinelle: bool if (foo) return true; else return false;

2016-04-20 Thread Joe Perches
There's ~150 of these in the kernel. Maybe there's use for this conversion to be added to scripts/coccinelle/misc/boolreturn.cocci or in a separate file. $ cat booltruefalse.cocci @@ identifier fn; expression e; typedef bool; symbol true; symbol false; @@ bool fn ( ... ) { <... - if (e)

Re: [Cocci] coccinelle: bool if (foo) return true; else return false;

2016-04-20 Thread Michael Stefaniuc
On 04/19/2016 09:15 PM, Julia Lawall wrote: > > > On Tue, 19 Apr 2016, Joe Perches wrote: > >> There's ~150 of these in the kernel. >> >> Maybe there's use for this conversion to be added >> to scripts/coccinelle/misc/boolreturn.cocci or in >> a separate file. >> >> $ cat booltruefalse.cocci >>

Re: [Cocci] coccinelle: bool if (foo) return true; else return false;

2016-04-19 Thread Julia Lawall
On Tue, 19 Apr 2016, Joe Perches wrote: > There's ~150 of these in the kernel. > > Maybe there's use for this conversion to be added > to scripts/coccinelle/misc/boolreturn.cocci or in > a separate file. > > $ cat booltruefalse.cocci > @@ > identifier fn; > expression e; > typedef bool; >