unsigned_lt_zero: re-write this check
The warning about unsigned variables less than zero is ancient and bad.
Pull it out into it's own check and re-write it. The main advantage of
the new check is that it doesn't warn about code like:
if (unsigned_val < 0 || unsigned_val > limit)
The code code is clearly intentional and should not generate a warning.
Smatch already tried to not warn about this but that code was quite
limited.
This code is still not really perfect. I want to make certain things like
if (x < ARRAY_SIZE()) where array size is zero not print a warning. Also
I probably want to change the warning message where the variable is not
unsigned but is only treated as unsigned because of type promotion. But
I'll do that in later patches.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>