Re: [PATCH] gpio: Convert gpio_is_valid to return bool

From: Linus Walleij
Date: Tue May 10 2011 - 19:42:27 EST


2011/5/11 Joe Perches <joe@xxxxxxxxxxx>:

> Make the code a bit more readable.
>
> Instead of casting an int to an unsigned then comparing to
> MAX_NR_GPIOS, add a >= 0 test and let the compiler optimizer
> do the conversion to unsigned.
>
> The generated code should be the same.
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>

Acked-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Thanks Joe!
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/