flash/nor/max32xxx: Use 'bool' data type 44/5744/2
authorMarc Schink <dev@zapb.de>
Wed, 1 Jul 2020 08:25:07 +0000 (10:25 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Wed, 8 Jul 2020 21:06:24 +0000 (22:06 +0100)
Change-Id: I828cdd6d97a59fd0692eb22ba8fc0a5759029432
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/5744
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/flash/nor/max32xxx.c

index 20ebbbf4fa9c7732fb853b980d8982062b6198ae..65898cd647001498389cc8fb953df3ae2b83803d 100644 (file)
@@ -70,7 +70,7 @@
 static int max32xxx_mass_erase(struct flash_bank *bank);
 
 struct max32xxx_flash_bank {
-       int probed;
+       bool probed;
        int max326xx;
        unsigned int flash_size;
        unsigned int flc_base;
@@ -118,7 +118,7 @@ static int get_info(struct flash_bank *bank, char *buf, int buf_size)
        int printed;
        struct max32xxx_flash_bank *info = bank->driver_priv;
 
-       if (info->probed == 0)
+       if (!info->probed)
                return ERROR_FLASH_BANK_NOT_PROBED;
 
        printed = snprintf(buf, buf_size, "\nMaxim Integrated max32xxx flash driver\n");
@@ -211,7 +211,7 @@ static int max32xxx_protect_check(struct flash_bank *bank)
        struct target *target = bank->target;
        uint32_t temp_reg;
 
-       if (info->probed == 0)
+       if (!info->probed)
                return ERROR_FLASH_BANK_NOT_PROBED;
 
        if (!info->max326xx) {
@@ -248,7 +248,7 @@ static int max32xxx_erase(struct flash_bank *bank, unsigned int first,
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (info->probed == 0)
+       if (!info->probed)
                return ERROR_FLASH_BANK_NOT_PROBED;
 
        if ((last < first) || (last >= bank->num_sectors))
@@ -333,7 +333,7 @@ static int max32xxx_protect(struct flash_bank *bank, int set,
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (info->probed == 0)
+       if (!info->probed)
                return ERROR_FLASH_BANK_NOT_PROBED;
 
        if (!info->max326xx)
@@ -459,7 +459,7 @@ static int max32xxx_write(struct flash_bank *bank, const uint8_t *buffer,
        LOG_DEBUG("bank=%p buffer=%p offset=%08" PRIx32 " count=%08" PRIx32 "",
                bank, buffer, offset, count);
 
-       if (info->probed == 0)
+       if (!info->probed)
                return ERROR_FLASH_BANK_NOT_PROBED;
 
        if (offset & 0x3) {
@@ -689,7 +689,7 @@ static int max32xxx_probe(struct flash_bank *bank)
        if (max32xxx_protect_check(bank) == ERROR_FLASH_OPER_UNSUPPORTED)
                LOG_WARNING("Flash protection not supported on this device");
 
-       info->probed = 1;
+       info->probed = true;
        return ERROR_OK;
 }
 
@@ -708,7 +708,7 @@ static int max32xxx_mass_erase(struct flash_bank *bank)
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (info->probed == 0)
+       if (!info->probed)
                return ERROR_FLASH_BANK_NOT_PROBED;
 
        int not_protected = 0;

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)