extra: tweak hard max in conditions and macros
commitf29718b7bb6bf85ab2d775b5b85d84d1e9d09900
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 12 Feb 2019 15:04:29 +0000 (12 18:04 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 12 Feb 2019 15:04:29 +0000 (12 18:04 +0300)
tree4f7d90f3069b3045544ba6a14c373d2dda44a951
parent4b4a7f7aa94513ef3e013a58cd89e0d1c7c4ddf4
extra: tweak hard max in conditions and macros

This is two changes but since it's on the same line, I'm committing them
together.

1)  If you have a macro then that's not a hard max.  This affects things
like:
for_each_set_bit(i, foo, BITS_PER_LONG) {

Smatch always thinks that "i" can go up to 63 and marks it as a hard max
but really it's just a macro and macros have crazy checks.

2)  Say you have a limit "limit = 5,7,9" and a condition "if (a < limit) {"
then in the original code it said that the limit has a hard max so "a" must
have a hard max.  That isn't true.  "a" only gets a hard max if you cap it
at a known value.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_extra.c