Home
last modified time | relevance | path

Searched hist:"3474 cb3c" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/include/linux/
H A Dgpio.h3474cb3c Tue May 10 18:23:07 CDT 2011 Joe Perches <joe@perches.com> gpio: Convert gpio_is_valid to return bool

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@perches.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
3474cb3c Tue May 10 18:23:07 CDT 2011 Joe Perches <joe@perches.com> gpio: Convert gpio_is_valid to return bool

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@perches.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>