openocd: fix Yoda conditions with checkpatch
[openocd.git] / src / jtag / drivers / buspirate.c
index 642ad12f44cedcb77e449e233e7f58bdb8ea669c..0864c60b325cdae8930144ba713b0b7f145e8491 100644 (file)
@@ -800,7 +800,7 @@ static void buspirate_tap_append(int tms, int tdi)
                int bit_index = tap_chain_index % 8;
                uint8_t bit = 1 << bit_index;
 
-               if (0 == bit_index) {
+               if (bit_index == 0) {
                        /* Let's say that the TAP shift operation wants to shift 9 bits,
                           so we will be sending to the Bus Pirate a bit count of 9 but still
                           full 16 bits (2 bytes) of shift data.
@@ -1178,13 +1178,13 @@ static int buspirate_serial_setspeed(int fd, char speed, cc_t timeout)
 
        /* set the serial port parameters */
        fcntl(fd, F_SETFL, 0);
-       if (0 != tcgetattr(fd, &t_opt))
+       if (tcgetattr(fd, &t_opt) != 0)
                return -1;
 
-       if (0 != cfsetispeed(&t_opt, baud))
+       if (cfsetispeed(&t_opt, baud) != 0)
                return -1;
 
-       if (0 != cfsetospeed(&t_opt, baud))
+       if (cfsetospeed(&t_opt, baud) != 0)
                return -1;
 
        t_opt.c_cflag |= (CLOCAL | CREAD);
@@ -1206,7 +1206,7 @@ static int buspirate_serial_setspeed(int fd, char speed, cc_t timeout)
        /* Note that, in the past, TCSANOW was used below instead of TCSADRAIN,
           and CMD_UART_SPEED did not work properly then, at least with
           the Bus Pirate v3.5 (USB). */
-       if (0 != tcsetattr(fd, TCSADRAIN, &t_opt)) {
+       if (tcsetattr(fd, TCSADRAIN, &t_opt) != 0) {
                /* According to the Linux documentation, this is actually not enough
                   to detect errors, you need to call tcgetattr() and check that
                   all changes have been performed successfully. */

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)