Re: [Cocci] linux: bad logic in repetitive tests

2020-03-31 Thread Joe Perches
On Tue, 2020-03-31 at 10:50 +0200, Julia Lawall wrote: > On Mon, 30 Mar 2020, Joe Perches wrote: > > > There is a block of if tests against the same variable > > in include/linux/mtd/pfow.h that likely is defective > > > > if (prog_status & 0x3) > > ... > > else if

Re: [Cocci] linux: bad logic in repetitive tests

2020-03-31 Thread Julia Lawall
On Tue, 31 Mar 2020, Joe Perches wrote: > On Tue, 2020-03-31 at 10:50 +0200, Julia Lawall wrote: > > On Mon, 30 Mar 2020, Joe Perches wrote: > > > > > There is a block of if tests against the same variable > > > in include/linux/mtd/pfow.h that likely is defective > > > > > > if (prog_s

Re: [Cocci] linux: bad logic in repetitive tests

2020-03-31 Thread Julia Lawall
On Mon, 30 Mar 2020, Joe Perches wrote: > There is a block of if tests against the same variable > in include/linux/mtd/pfow.h that likely is defective > > if (prog_status & 0x3) > ... > else if (prog_status & 0x2) > ... > else (prog_statu

[Cocci] linux: bad logic in repetitive tests

2020-03-30 Thread Joe Perches
There is a block of if tests against the same variable in include/linux/mtd/pfow.h that likely is defective if (prog_status & 0x3) ... else if (prog_status & 0x2) ... else (prog_status & 0x1) ... If the first test is true the