stlink: collapse consecutive mem AP r/w in a single command
[openocd.git] / src / flash / nor / nrf5.c
index 9decbea9df42e8ad53177756828c9ce4fe0e1c83..c96415547b5c1c171c1cf6a19d167baf7a1e5684 100644 (file)
@@ -23,6 +23,7 @@
 #endif
 
 #include "imp.h"
+#include <helper/binarybuffer.h>
 #include <target/algorithm.h>
 #include <target/armv7m.h>
 #include <helper/types.h>
@@ -293,7 +294,7 @@ static bool nrf5_bank_is_probed(const struct flash_bank *bank)
 {
        struct nrf5_bank *nbank = bank->driver_priv;
 
-       assert(nbank != NULL);
+       assert(nbank);
 
        return nbank->probed;
 }
@@ -444,7 +445,7 @@ static int nrf5_protect_check_clenr0(struct flash_bank *bank)
        struct nrf5_bank *nbank = bank->driver_priv;
        struct nrf5_info *chip = nbank->chip;
 
-       assert(chip != NULL);
+       assert(chip);
 
        res = target_read_u32(chip->target, NRF51_FICR_CLENR0,
                              &clenr0);
@@ -474,7 +475,7 @@ static int nrf5_protect_check_bprot(struct flash_bank *bank)
        struct nrf5_bank *nbank = bank->driver_priv;
        struct nrf5_info *chip = nbank->chip;
 
-       assert(chip != NULL);
+       assert(chip);
 
        static uint32_t nrf5_bprot_offsets[4] = { 0x600, 0x604, 0x610, 0x614 };
        uint32_t bprot_reg = 0;
@@ -505,7 +506,7 @@ static int nrf5_protect_check(struct flash_bank *bank)
        struct nrf5_bank *nbank = bank->driver_priv;
        struct nrf5_info *chip = nbank->chip;
 
-       assert(chip != NULL);
+       assert(chip);
 
        if (chip->features & NRF5_FEATURE_BPROT)
                return nrf5_protect_check_bprot(bank);
@@ -1133,7 +1134,7 @@ static void nrf5_free_driver_priv(struct flash_bank *bank)
 {
        struct nrf5_bank *nbank = bank->driver_priv;
        struct nrf5_info *chip = nbank->chip;
-       if (chip == NULL)
+       if (!chip)
                return;
 
        chip->refcount--;
@@ -1197,7 +1198,7 @@ FLASH_BANK_COMMAND_HANDLER(nrf5_flash_bank_command)
                nbank = &chip->bank[1];
                break;
        }
-       assert(nbank != NULL);
+       assert(nbank);
 
        chip->refcount++;
        nbank->chip = chip;
@@ -1218,7 +1219,7 @@ COMMAND_HANDLER(nrf5_handle_mass_erase_command)
        if (res != ERROR_OK)
                return res;
 
-       assert(bank != NULL);
+       assert(bank);
 
        struct nrf5_info *chip;
 
@@ -1265,7 +1266,7 @@ COMMAND_HANDLER(nrf5_handle_info_command)
        if (res != ERROR_OK)
                return res;
 
-       assert(bank != NULL);
+       assert(bank);
 
        struct nrf5_info *chip;
 

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)