aboutsummaryrefslogtreecommitdiff
path: root/include/linux/gpio.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-05-10 16:23:07 -0700
committerGrant Likely <grant.likely@secretlab.ca>2011-05-26 21:02:43 -0600
commit3474cb3cc0140f9cf6ca56983f8180b4b4c5c36a (patch)
tree73abf5a283fb330ef15c7cb8e9d0cc264f03ab5f /include/linux/gpio.h
parent82ab0f75ee2f5defe300eadc91635aa455e01afd (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>
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r--include/linux/gpio.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 32720baf70f..0f8265f8e8c 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -25,9 +25,9 @@ struct gpio_chip;
* warning when something is wrongly called.
*/
-static inline int gpio_is_valid(int number)
+static inline bool gpio_is_valid(int number)
{
- return 0;
+ return false;
}
static inline int gpio_request(unsigned gpio, const char *label)