flash/nor/cfi: Use 'bool' data type
[openocd.git] / src / flash / nor / cfi.c
index 19fb6b2c2ceef95c5dfd5df522205230ec2cb613..9d2a53a6bc971c7d696f6060e22dd41cd7ef0399 100644 (file)
@@ -814,7 +814,7 @@ static int cfi_intel_info(struct flash_bank *bank, char *buf, int buf_size)
 int cfi_flash_bank_cmd(struct flash_bank *bank, unsigned int argc, const char **argv)
 {
        struct cfi_flash_bank *cfi_info;
-       int bus_swap = 0;
+       bool bus_swap = false;
 
        if (argc < 6)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -841,20 +841,20 @@ int cfi_flash_bank_cmd(struct flash_bank *bank, unsigned int argc, const char **
        cfi_info->pri_ext = NULL;
        bank->driver_priv = cfi_info;
 
-       cfi_info->x16_as_x8 = 0;
-       cfi_info->jedec_probe = 0;
-       cfi_info->not_cfi = 0;
-       cfi_info->data_swap = 0;
+       cfi_info->x16_as_x8 = false;
+       cfi_info->jedec_probe = false;
+       cfi_info->not_cfi = false;
+       cfi_info->data_swap = false;
 
        for (unsigned i = 6; i < argc; i++) {
                if (strcmp(argv[i], "x16_as_x8") == 0)
-                       cfi_info->x16_as_x8 = 1;
+                       cfi_info->x16_as_x8 = true;
                else if (strcmp(argv[i], "data_swap") == 0)
-                       cfi_info->data_swap = 1;
+                       cfi_info->data_swap = true;
                else if (strcmp(argv[i], "bus_swap") == 0)
-                       bus_swap = 1;
+                       bus_swap = true;
                else if (strcmp(argv[i], "jedec_probe") == 0)
-                       cfi_info->jedec_probe = 1;
+                       cfi_info->jedec_probe = true;
        }
 
        if (bus_swap)
@@ -2661,7 +2661,7 @@ int cfi_probe(struct flash_bank *bank)
        /* query only if this is a CFI compatible flash,
         * otherwise the relevant info has already been filled in
         */
-       if (cfi_info->not_cfi == 0) {
+       if (!cfi_info->not_cfi) {
                /* enter CFI query mode
                 * according to JEDEC Standard No. 68.01,
                 * a single bus sequence with address = 0x55, data = 0x98 should put
@@ -3011,7 +3011,7 @@ int cfi_get_info(struct flash_bank *bank, char *buf, int buf_size)
                return ERROR_OK;
        }
 
-       if (cfi_info->not_cfi == 0)
+       if (!cfi_info->not_cfi)
                printed = snprintf(buf, buf_size, "\nCFI flash: ");
        else
                printed = snprintf(buf, buf_size, "\nnon-CFI flash: ");

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)