Re: [PATCH] pinctrl: pinctrl-msm.c: Cleaning up if unsigned is less than zero

From: Linus Walleij
Date: Mon Jul 07 2014 - 11:41:03 EST


On Thu, Jun 26, 2014 at 1:31 PM, Rickard Strandqvist
<rickard_strandqvist@xxxxxxxxxxxxxxxxxx> wrote:

> Remove checking if a unsigned is less than zero
>
> This was found using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@xxxxxxxxxxxxxxxxxx>
(...)
> - if (WARN_ON(g->mux_bit < 0))
> + if (WARN_ON(g->mux_bit != 0))

Is that correct?

If the variable cannot be < 0 should the check not simply be
deleted, since this is all it checks for?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/