flash/nor: Use proper data types in driver API
[openocd.git] / src / flash / nor / nrf5.c
index fa67e2bf3ce2471e80407fc9404d118c9d18a9ee..a79aa78b907cfb8f5955e06abddd26d467d2d2e4 100644 (file)
@@ -451,7 +451,7 @@ static int nrf5_protect_check_bprot(struct flash_bank *bank)
        uint32_t bprot_reg = 0;
        int res;
 
-       for (int i = 0; i < bank->num_sectors; i++) {
+       for (unsigned int i = 0; i < bank->num_sectors; i++) {
                unsigned int bit = i % 32;
                if (bit == 0) {
                        unsigned int n_reg = i / 32;
@@ -505,14 +505,15 @@ static int nrf5_protect_check(struct flash_bank *bank)
                }
        }
 
-       for (int i = 0; i < bank->num_sectors; i++)
+       for (unsigned int i = 0; i < bank->num_sectors; i++)
                bank->sectors[i].is_protected =
                        clenr0 != 0xFFFFFFFF && bank->sectors[i].offset < clenr0;
 
        return ERROR_OK;
 }
 
-static int nrf5_protect(struct flash_bank *bank, int set, int first, int last)
+static int nrf5_protect(struct flash_bank *bank, int set, unsigned int first,
+               unsigned int last)
 {
        int res;
        uint32_t clenr0, ppfc;
@@ -1027,7 +1028,8 @@ error:
        return res;
 }
 
-static int nrf5_erase(struct flash_bank *bank, int first, int last)
+static int nrf5_erase(struct flash_bank *bank, unsigned int first,
+               unsigned int last)
 {
        int res;
        struct nrf5_info *chip;
@@ -1037,7 +1039,7 @@ static int nrf5_erase(struct flash_bank *bank, int first, int last)
                return res;
 
        /* For each sector to be erased */
-       for (int s = first; s <= last && res == ERROR_OK; s++)
+       for (unsigned int s = first; s <= last && res == ERROR_OK; s++)
                res = nrf5_erase_page(bank, chip, &bank->sectors[s]);
 
        return res;

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)