[PATCH 1/6] pinctrl: imx: fix unsigned check if nfuncs with less than or equal zero

Linus Walleij linus.walleij at linaro.org
Wed May 2 05:22:22 PDT 2018


On Fri, Apr 27, 2018 at 9:01 PM, Dong Aisheng <aisheng.dong at nxp.com> wrote:

> The unsigned integer nfuncs is being error checked with a value less
> or equal to zero; this is always false if of_get_child_count returns a
> -ve for an error condition since nfuncs is not signed. Fix this by
> making variables nfuncs and i signed integers.
>
> Detected with Coccinelle:
> drivers/pinctrl/freescale/pinctrl-imx.c:620:6-12: WARNING: Unsigned
> expression compared with zero: nfuncs <= 0
>
> Cc: Linus Walleij <linus.walleij at linaro.org>
> Reported-by: Colin Ian King <colin.king at canonical.com>
> Signed-off-by: Dong Aisheng <aisheng.dong at nxp.com>

Patch applied.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list