commit | 3474cb3cc0140f9cf6ca56983f8180b4b4c5c36a | [log] [tgz] |
---|---|---|
author | Joe Perches <joe@perches.com> | Tue May 10 16:23:07 2011 -0700 |
committer | Grant Likely <grant.likely@secretlab.ca> | Thu May 26 21:02:43 2011 -0600 |
tree | 73abf5a283fb330ef15c7cb8e9d0cc264f03ab5f | |
parent | 82ab0f75ee2f5defe300eadc91635aa455e01afd [diff] |
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>