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

index 1e2a4b176ca460ab3b959fb17ce0aa145a9260f5..622943d284e2ec3a696b3589610d9150b60aacdf 100644 (file)
@@ -92,7 +92,7 @@ static const uint32_t apollo_sram_size[] = {
 struct ambiqmicro_flash_bank {
        /* chip id register */
 
-       uint32_t probed;
+       bool probed;
 
        const char *target_name;
        uint8_t target_class;
@@ -156,7 +156,7 @@ FLASH_BANK_COMMAND_HANDLER(ambiqmicro_flash_bank_command)
        ambiqmicro_info->target_name = "Unknown target";
 
        /* part wasn't probed yet */
-       ambiqmicro_info->probed = 0;
+       ambiqmicro_info->probed = false;
 
        return ERROR_OK;
 }
@@ -167,7 +167,7 @@ static int get_ambiqmicro_info(struct flash_bank *bank, char *buf, int buf_size)
        int printed;
        char *classname;
 
-       if (ambiqmicro_info->probed == 0) {
+       if (!ambiqmicro_info->probed) {
                LOG_ERROR("Target not probed");
                return ERROR_FLASH_BANK_NOT_PROBED;
        }
@@ -280,7 +280,7 @@ static int ambiqmicro_protect_check(struct flash_bank *bank)
        uint32_t i;
 
 
-       if (ambiqmicro->probed == 0) {
+       if (!ambiqmicro->probed) {
                LOG_ERROR("Target not probed");
                return ERROR_FLASH_BANK_NOT_PROBED;
        }
@@ -371,7 +371,7 @@ static int ambiqmicro_mass_erase(struct flash_bank *bank)
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (ambiqmicro_info->probed == 0) {
+       if (!ambiqmicro_info->probed) {
                LOG_ERROR("Target not probed");
                return ERROR_FLASH_BANK_NOT_PROBED;
        }
@@ -439,7 +439,7 @@ static int ambiqmicro_erase(struct flash_bank *bank, unsigned int first,
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (ambiqmicro_info->probed == 0) {
+       if (!ambiqmicro_info->probed) {
                LOG_ERROR("Target not probed");
                return ERROR_FLASH_BANK_NOT_PROBED;
        }
@@ -659,7 +659,7 @@ static int ambiqmicro_probe(struct flash_bank *bank)
        /* If this is a ambiqmicro chip, it has flash; probe() is just
         * to figure out how much is present.  Only do it once.
         */
-       if (ambiqmicro_info->probed == 1) {
+       if (ambiqmicro_info->probed) {
                LOG_INFO("Target already probed");
                return ERROR_OK;
        }
@@ -691,7 +691,7 @@ static int ambiqmicro_probe(struct flash_bank *bank)
        /*
         * Part has been probed.
         */
-       ambiqmicro_info->probed = 1;
+       ambiqmicro_info->probed = true;
 
        return retval;
 }
@@ -711,7 +711,7 @@ static int ambiqmicro_otp_program(struct flash_bank *bank,
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (ambiqmicro_info->probed == 0) {
+       if (!ambiqmicro_info->probed) {
                LOG_ERROR("Target not probed");
                return ERROR_FLASH_BANK_NOT_PROBED;
        }

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)