From 2552a2e2b72cedfe0bf573f8ebcfc64c5d19bed5 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sat, 10 Nov 2018 16:23:32 -0500 Subject: replace if(cond)return bool;return !bool; with return !cond --- gpio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gpio.c') 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) -- cgit v1.2.1