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
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
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
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
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
5 matches
Mail list logo