summaryrefslogtreecommitdiff
path: root/gpio.c
diff options
context:
space:
mode:
authorJakob Kaivo <jakob@kaivo.net>2018-11-10 16:23:32 -0500
committerJakob Kaivo <jakob@kaivo.net>2018-11-10 16:23:32 -0500
commit2552a2e2b72cedfe0bf573f8ebcfc64c5d19bed5 (patch)
tree04f493777c1e25381170d0da8decdf3c80e72636 /gpio.c
parent4a418eac71a348e0fc06abcf7938c217b2085ddf (diff)
replace if(cond)return bool;return !bool; with return !cond
Diffstat (limited to 'gpio.c')
-rw-r--r--gpio.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gpio.c b/gpio.c
index c72ba0f..c381be1 100644
--- a/gpio.c
+++ b/gpio.c
@@ -26,10 +26,7 @@ int gpio_get(int port)
int fd = gpio_open(port, "value", O_RDONLY);
read(fd, &c, 1);
close(fd);
- if (c == '0') {
- return 0;
- }
- return 1;
+ return c != '0';
}
void gpio_set(int port)