Re: [PATCH] scripts/coccinelle/misc/shift.cocci: detect < or > that should be a shift

2018-02-08 Thread Dan Carpenter
On Thu, Feb 08, 2018 at 02:58:56PM +0100, Julia Lawall wrote: > > > On Thu, 8 Feb 2018, Dan Carpenter wrote: > > > On Thu, Feb 08, 2018 at 01:53:54PM +0100, Julia Lawall wrote: > > > This checks for a comparison using < or > between two constants, > > > considering both explicit constants (1, 2,

Re: [PATCH] scripts/coccinelle/misc/shift.cocci: detect < or > that should be a shift

2018-02-08 Thread Julia Lawall
On Thu, 8 Feb 2018, Dan Carpenter wrote: > On Thu, Feb 08, 2018 at 01:53:54PM +0100, Julia Lawall wrote: > > This checks for a comparison using < or > between two constants, > > considering both explicit constants (1, 2, etc) and macros defined > > with #define. False positives are possible in

Re: [PATCH] scripts/coccinelle/misc/shift.cocci: detect < or > that should be a shift

2018-02-08 Thread Dan Carpenter
On Thu, Feb 08, 2018 at 01:53:54PM +0100, Julia Lawall wrote: > This checks for a comparison using < or > between two constants, > considering both explicit constants (1, 2, etc) and macros defined > with #define. False positives are possible in the latter case, when > a macro may have multiple po

[PATCH] scripts/coccinelle/misc/shift.cocci: detect < or > that should be a shift

2018-02-08 Thread Julia Lawall
This checks for a comparison using < or > between two constants, considering both explicit constants (1, 2, etc) and macros defined with #define. False positives are possible in the latter case, when a macro may have multiple possible definitions and it is indeed necessary to check the value. The