sysfsgpio: minor fix for bool types 52/5552/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Sun, 29 Mar 2020 21:19:29 +0000 (23:19 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 12 Apr 2020 21:01:18 +0000 (22:01 +0100)
Return bool value in functions that return bool.
Change return type to bool to function is_gpio_valid().

Change-Id: Ic2e62be737772b22e69881c034956549f659370b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5552
Tested-by: jenkins
Reviewed-by: Marc Schink <dev@zapb.de>
src/jtag/drivers/sysfsgpio.c

index bf33767c811a0532396bbd8e75a8ceafe6d46bde..c398d53840714a29f0370cab86b49744f92096d6 100644 (file)
@@ -61,7 +61,7 @@
  *
  * Assume here that there will be less than 10000 gpios on a system
  */
-static int is_gpio_valid(int gpio)
+static bool is_gpio_valid(int gpio)
 {
        return gpio >= 0 && gpio < 10000;
 }
@@ -603,23 +603,23 @@ static void cleanup_all_fds(void)
 static bool sysfsgpio_jtag_mode_possible(void)
 {
        if (!is_gpio_valid(tck_gpio))
-               return 0;
+               return false;
        if (!is_gpio_valid(tms_gpio))
-               return 0;
+               return false;
        if (!is_gpio_valid(tdi_gpio))
-               return 0;
+               return false;
        if (!is_gpio_valid(tdo_gpio))
-               return 0;
-       return 1;
+               return false;
+       return true;
 }
 
 static bool sysfsgpio_swd_mode_possible(void)
 {
        if (!is_gpio_valid(swclk_gpio))
-               return 0;
+               return false;
        if (!is_gpio_valid(swdio_gpio))
-               return 0;
-       return 1;
+               return false;
+       return true;
 }
 
 static int sysfsgpio_init(void)

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)