Re: [patch] trace: cleanup: make some types unsigned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2011-10-07 at 16:27 +0300, Dan Carpenter wrote:
> The problem here is that I'm trying to silence a static checker
> warning.  In replace_preds() we cap n_preds at MAX_FILTER_PRED but
> we don't check for negative values.  It can't actually be negative
> values, but the static checkers get confused.

I really hate to uglify code for the sake of static checkers.

This code may change in the near future, and the possibility that
n_preds may become a possibility. Perhaps we should add a:

WARN_ON(n_preds < 0);

If in the future the count_preds() changes and incorrectly produces a
negative number, or perhaps even overflows int, we wont catch it with
unsigned.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux