Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Dan Carpenter wrote: > That found 4 that I think Wolfram's grep missed. > > arch/um/drivers/vector_user.h |2 -- > drivers/gpu/drm/mxsfb/mxsfb_regs.h|2 -- > drivers/video/fbdev/mxsfb.c |2 -- > include/drm/drm_scdc_helper.h

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Dan Carpenter wrote: > That found 4 that I think Wolfram's grep missed. > > arch/um/drivers/vector_user.h |2 -- > drivers/gpu/drm/mxsfb/mxsfb_regs.h|2 -- > drivers/video/fbdev/mxsfb.c |2 -- > include/drm/drm_scdc_helper.h

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Dan Carpenter
That found 4 that I think Wolfram's grep missed. arch/um/drivers/vector_user.h |2 -- drivers/gpu/drm/mxsfb/mxsfb_regs.h|2 -- drivers/video/fbdev/mxsfb.c |2 -- include/drm/drm_scdc_helper.h |3 --- But it didn't find the two bugs

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Dan Carpenter
That found 4 that I think Wolfram's grep missed. arch/um/drivers/vector_user.h |2 -- drivers/gpu/drm/mxsfb/mxsfb_regs.h|2 -- drivers/video/fbdev/mxsfb.c |2 -- include/drm/drm_scdc_helper.h |3 --- But it didn't find the two bugs

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Wolfram Sang
> I did that too but got no results. Perhaps right shifting constants is > pretty uncommon. I can put that in the complete rule though. Please do. Even if rare, we would want this bug pointed out, right? :) signature.asc Description: PGP signature

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Wolfram Sang
> I did that too but got no results. Perhaps right shifting constants is > pretty uncommon. I can put that in the complete rule though. Please do. Even if rare, we would want this bug pointed out, right? :) signature.asc Description: PGP signature

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Wolfram Sang wrote: > Hi Julia, > > > and got the results below. I can make a version for the kernel shortly. > > It should probably take care of right-shifting, too? I did that too but got no results. Perhaps right shifting constants is pretty uncommon. I can put that

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Wolfram Sang wrote: > Hi Julia, > > > and got the results below. I can make a version for the kernel shortly. > > It should probably take care of right-shifting, too? I did that too but got no results. Perhaps right shifting constants is pretty uncommon. I can put that

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Wolfram Sang
Hi Julia, > and got the results below. I can make a version for the kernel shortly. It should probably take care of right-shifting, too? Thanks, Wolfram signature.asc Description: PGP signature

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Wolfram Sang
Hi Julia, > and got the results below. I can make a version for the kernel shortly. It should probably take care of right-shifting, too? Thanks, Wolfram signature.asc Description: PGP signature

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Dan Carpenter wrote: > On Tue, Feb 06, 2018 at 02:15:51PM +0100, Julia Lawall wrote: > > > > > > On Tue, 6 Feb 2018, Dan Carpenter wrote: > > > > > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > > > In one Renesas driver, I found a typo which turned an

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Dan Carpenter wrote: > On Tue, Feb 06, 2018 at 02:15:51PM +0100, Julia Lawall wrote: > > > > > > On Tue, 6 Feb 2018, Dan Carpenter wrote: > > > > > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > > > In one Renesas driver, I found a typo which turned an

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Dan Carpenter
On Tue, Feb 06, 2018 at 02:15:51PM +0100, Julia Lawall wrote: > > > On Tue, 6 Feb 2018, Dan Carpenter wrote: > > > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > > In one Renesas driver, I found a typo which turned an intended bit shift > > > ('<<') > > > into a comparison

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Dan Carpenter
On Tue, Feb 06, 2018 at 02:15:51PM +0100, Julia Lawall wrote: > > > On Tue, 6 Feb 2018, Dan Carpenter wrote: > > > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > > In one Renesas driver, I found a typo which turned an intended bit shift > > > ('<<') > > > into a comparison

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Dan Carpenter wrote: > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > In one Renesas driver, I found a typo which turned an intended bit shift > > ('<<') > > into a comparison ('<'). Because this is a subtle issue, I looked tree wide > > for > > similar

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Julia Lawall
On Tue, 6 Feb 2018, Dan Carpenter wrote: > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > In one Renesas driver, I found a typo which turned an intended bit shift > > ('<<') > > into a comparison ('<'). Because this is a subtle issue, I looked tree wide > > for > > similar

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Dan Carpenter
On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > In one Renesas driver, I found a typo which turned an intended bit shift > ('<<') > into a comparison ('<'). Because this is a subtle issue, I looked tree wide > for > similar patterns. This small patch series is the outcome. > >

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Dan Carpenter
On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > In one Renesas driver, I found a typo which turned an intended bit shift > ('<<') > into a comparison ('<'). Because this is a subtle issue, I looked tree wide > for > similar patterns. This small patch series is the outcome. > >

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Wolfram Sang
> I found two more using "git grep 'define.*0x[0-9a-f]* < '": I added '[0-9]\+' at the end of the regex to reduce the number of false positives... > drivers/net/can/m_can/m_can.c:#define RXFC_FWM_MASK (0x7f < > RXFC_FWM_SHIFT) > drivers/usb/gadget/udc/goku_udc.h:#define INT_EPnNAK(n) >

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Wolfram Sang
> I found two more using "git grep 'define.*0x[0-9a-f]* < '": I added '[0-9]\+' at the end of the regex to reduce the number of false positives... > drivers/net/can/m_can/m_can.c:#define RXFC_FWM_MASK (0x7f < > RXFC_FWM_SHIFT) > drivers/usb/gadget/udc/goku_udc.h:#define INT_EPnNAK(n) >

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Geert Uytterhoeven
Hi Wolfram, On Mon, Feb 5, 2018 at 9:09 PM, Wolfram Sang wrote: > In one Renesas driver, I found a typo which turned an intended bit shift > ('<<') > into a comparison ('<'). Because this is a subtle issue, I looked tree wide > for > similar patterns. This

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Geert Uytterhoeven
Hi Wolfram, On Mon, Feb 5, 2018 at 9:09 PM, Wolfram Sang wrote: > In one Renesas driver, I found a typo which turned an intended bit shift > ('<<') > into a comparison ('<'). Because this is a subtle issue, I looked tree wide > for > similar patterns. This small patch series is the outcome. >

[PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-05 Thread Wolfram Sang
In one Renesas driver, I found a typo which turned an intended bit shift ('<<') into a comparison ('<'). Because this is a subtle issue, I looked tree wide for similar patterns. This small patch series is the outcome. Buildbot and checkpatch are happy. Only compile-tested. To be applied

[PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-05 Thread Wolfram Sang
In one Renesas driver, I found a typo which turned an intended bit shift ('<<') into a comparison ('<'). Because this is a subtle issue, I looked tree wide for similar patterns. This small patch series is the outcome. Buildbot and checkpatch are happy. Only compile-tested. To be applied