Re: [PATCH 2/2] test_firmware: silence underflow warning in test_dev_config_update_u8()

2019-02-21 Thread Dan Carpenter
I've looked at this some more and I don't think it's a good idea to change the type of U8_MAX. Right now INT_MAX is int and USHRT_MAX is unsigned short etc. That's the only intuitive thing for them to be. regards, dan carpenter

Re: [PATCH 2/2] test_firmware: silence underflow warning in test_dev_config_update_u8()

2019-02-21 Thread Andrew Morton
On Thu, 21 Feb 2019 22:18:56 +0300 Dan Carpenter wrote: > On Thu, Feb 21, 2019 at 10:54:58AM -0800, Andrew Morton wrote: > > On Thu, 21 Feb 2019 21:38:26 +0300 Dan Carpenter > > wrote: > > > > > We put an upper bound on "new" but we don't check for negatives. > > > > U8_MAX has unsigned

Re: [PATCH 2/2] test_firmware: silence underflow warning in test_dev_config_update_u8()

2019-02-21 Thread Dan Carpenter
On Thu, Feb 21, 2019 at 10:54:58AM -0800, Andrew Morton wrote: > On Thu, 21 Feb 2019 21:38:26 +0300 Dan Carpenter > wrote: > > > We put an upper bound on "new" but we don't check for negatives. > > U8_MAX has unsigned type, so `if (new > U8_MAX)' does check for negative. > No, doesn't work

Re: [PATCH 2/2] test_firmware: silence underflow warning in test_dev_config_update_u8()

2019-02-21 Thread Andrew Morton
On Thu, 21 Feb 2019 21:38:26 +0300 Dan Carpenter wrote: > We put an upper bound on "new" but we don't check for negatives. U8_MAX has unsigned type, so `if (new > U8_MAX)' does check for negative. > In > this case the underflow doesn't matter very much, but we may as well > make the static

[PATCH 2/2] test_firmware: silence underflow warning in test_dev_config_update_u8()

2019-02-21 Thread Dan Carpenter
We put an upper bound on "new" but we don't check for negatives. In this case the underflow doesn't matter very much, but we may as well make the static checker happy. Signed-off-by: Dan Carpenter --- lib/test_firmware.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git