Re: [PATCH] lib/test_kmod: Fix an integer overflow test

2018-02-24 Thread Dan Carpenter
On Sat, Feb 24, 2018 at 10:06:01PM +, Luis R. Rodriguez wrote: > On Sat, Feb 24, 2018 at 11:45:16AM +0300, Dan Carpenter wrote: > > On Sat, Feb 24, 2018 at 02:59:41AM +, Luis R. Rodriguez wrote: > > > On Mon, Jan 22, 2018 at 01:27:54PM +0300, Dan Carpenter wrote: > > > > The main problem is

Re: [PATCH] lib/test_kmod: Fix an integer overflow test

2018-02-24 Thread Luis R. Rodriguez
On Sat, Feb 24, 2018 at 11:45:16AM +0300, Dan Carpenter wrote: > On Sat, Feb 24, 2018 at 02:59:41AM +, Luis R. Rodriguez wrote: > > On Mon, Jan 22, 2018 at 01:27:54PM +0300, Dan Carpenter wrote: > > > The main problem is that the parentheses are in the wrong place and the > > > unlikely() call

Re: [PATCH] lib/test_kmod: Fix an integer overflow test

2018-02-24 Thread Dan Carpenter
On Sat, Feb 24, 2018 at 02:59:41AM +, Luis R. Rodriguez wrote: > On Mon, Jan 22, 2018 at 01:27:54PM +0300, Dan Carpenter wrote: > > The main problem is that the parentheses are in the wrong place and the > > unlikely() call returns either 0 or 1 so it's never less than zero. > > Doh, thanks, y

Re: [PATCH] lib/test_kmod: Fix an integer overflow test

2018-02-23 Thread Luis R. Rodriguez
On Mon, Jan 22, 2018 at 01:27:54PM +0300, Dan Carpenter wrote: > The main problem is that the parentheses are in the wrong place and the > unlikely() call returns either 0 or 1 so it's never less than zero. Doh, thanks, yes. Seems worth considering a grammar rule for it. > The other problem is th

[PATCH] lib/test_kmod: Fix an integer overflow test

2018-01-22 Thread Dan Carpenter
The main problem is that the parentheses are in the wrong place and the unlikely() call returns either 0 or 1 so it's never less than zero. The other problem is that signed integer overflows like "INT_MAX + 1" are undefined behavior. Fixes: d9c6a72d6fa2 ("kmod: add test driver to stress test the