diff options
| author | Jakob Kaivo <jakob@kaivo.net> | 2018-11-10 16:23:32 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jakob@kaivo.net> | 2018-11-10 16:23:32 -0500 |
| commit | 2552a2e2b72cedfe0bf573f8ebcfc64c5d19bed5 (patch) | |
| tree | 04f493777c1e25381170d0da8decdf3c80e72636 | |
| parent | 4a418eac71a348e0fc06abcf7938c217b2085ddf (diff) | |
replace if(cond)return bool;return !bool; with return !cond
| -rw-r--r-- | gpio.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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) |
