command_handler: change 'args' to CMD_ARGV
[openocd.git] / src / flash / str9xpec.c
index 4bf5bcaec49c12625af577143f50788c7460bc84..a87d0fff46402e6891f2435b79a428b06c7c3f73 100644 (file)
@@ -44,7 +44,7 @@ int str9xpec_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end
 
                field.tap = tap;
                field.num_bits = tap->ir_length;
-               field.out_value = calloc(CEIL(field.num_bits, 8), 1);
+               field.out_value = calloc(DIV_ROUND_UP(field.num_bits, 8), 1);
                buf_set_u32(field.out_value, 0, field.num_bits, new_instr);
                field.in_value = NULL;
 
@@ -242,7 +242,7 @@ FLASH_BANK_COMMAND_HANDLER(str9xpec_flash_bank_command)
        struct arm7_9_common *arm7_9 = NULL;
        struct arm_jtag *jtag_info = NULL;
 
-       if (argc < 6)
+       if (CMD_ARGC < 6)
        {
                LOG_WARNING("incomplete flash_bank str9x configuration");
                return ERROR_FLASH_BANK_INVALID;
@@ -289,7 +289,7 @@ static int str9xpec_blank_check(struct flash_bank *bank, int first, int last)
                return ERROR_FLASH_OPERATION_FAILED;
        }
 
-       buffer = calloc(CEIL(64, 8), 1);
+       buffer = calloc(DIV_ROUND_UP(64, 8), 1);
 
        LOG_DEBUG("blank check: first_bank: %i, last_bank: %i", first, last);
 
@@ -378,7 +378,7 @@ static int str9xpec_erase_area(struct flash_bank *bank, int first, int last)
                return ISC_STATUS_ERROR;
        }
 
-       buffer = calloc(CEIL(64, 8), 1);
+       buffer = calloc(DIV_ROUND_UP(64, 8), 1);
 
        LOG_DEBUG("erase: first_bank: %i, last_bank: %i", first, last);
 
@@ -618,7 +618,7 @@ static int str9xpec_write(struct flash_bank *bank, uint8_t *buffer, uint32_t off
 
        LOG_DEBUG("first_sector: %i, last_sector: %i", first_sector, last_sector);
 
-       scanbuf = calloc(CEIL(64, 8), 1);
+       scanbuf = calloc(DIV_ROUND_UP(64, 8), 1);
 
        LOG_DEBUG("ISC_PROGRAM");
 
@@ -734,7 +734,7 @@ COMMAND_HANDLER(str9xpec_handle_part_id_command)
        uint32_t idcode;
        struct str9xpec_flash_controller *str9xpec_info = NULL;
 
-       if (argc < 1)
+       if (CMD_ARGC < 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        struct flash_bank *bank;
@@ -745,7 +745,7 @@ COMMAND_HANDLER(str9xpec_handle_part_id_command)
        str9xpec_info = bank->driver_priv;
        tap = str9xpec_info->tap;
 
-       buffer = calloc(CEIL(32, 8), 1);
+       buffer = calloc(DIV_ROUND_UP(32, 8), 1);
 
        str9xpec_set_instr(tap, ISC_IDCODE, TAP_IRPAUSE);
 
@@ -782,7 +782,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_read_command)
        uint8_t status;
        struct str9xpec_flash_controller *str9xpec_info = NULL;
 
-       if (argc < 1)
+       if (CMD_ARGC < 1)
        {
                command_print(cmd_ctx, "str9xpec options_read <bank>");
                return ERROR_OK;
@@ -898,7 +898,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_write_command)
 {
        uint8_t status;
 
-       if (argc < 1)
+       if (CMD_ARGC < 1)
        {
                command_print(cmd_ctx, "str9xpec options_write <bank>");
                return ERROR_OK;
@@ -921,7 +921,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_cmap_command)
 {
        struct str9xpec_flash_controller *str9xpec_info = NULL;
 
-       if (argc < 2)
+       if (CMD_ARGC < 2)
        {
                command_print(cmd_ctx, "str9xpec options_cmap <bank> <bank0 | bank1>");
                return ERROR_OK;
@@ -934,7 +934,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_cmap_command)
 
        str9xpec_info = bank->driver_priv;
 
-       if (strcmp(args[1], "bank1") == 0)
+       if (strcmp(CMD_ARGV[1], "bank1") == 0)
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_CSMAPBIT, 1, 1);
        }
@@ -950,7 +950,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdthd_command)
 {
        struct str9xpec_flash_controller *str9xpec_info = NULL;
 
-       if (argc < 2)
+       if (CMD_ARGC < 2)
        {
                command_print(cmd_ctx, "str9xpec options_lvdthd <bank> <2.4v | 2.7v>");
                return ERROR_OK;
@@ -963,7 +963,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdthd_command)
 
        str9xpec_info = bank->driver_priv;
 
-       if (strcmp(args[1], "2.7v") == 0)
+       if (strcmp(CMD_ARGV[1], "2.7v") == 0)
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_LVDTHRESBIT, 1, 1);
        }
@@ -979,7 +979,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdsel_command)
 {
        struct str9xpec_flash_controller *str9xpec_info = NULL;
 
-       if (argc < 2)
+       if (CMD_ARGC < 2)
        {
                command_print(cmd_ctx, "str9xpec options_lvdsel <bank> <vdd | vdd_vddq>");
                return ERROR_OK;
@@ -992,7 +992,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdsel_command)
 
        str9xpec_info = bank->driver_priv;
 
-       if (strcmp(args[1], "vdd_vddq") == 0)
+       if (strcmp(CMD_ARGV[1], "vdd_vddq") == 0)
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_LVDSELBIT, 1, 1);
        }
@@ -1008,7 +1008,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdwarn_command)
 {
        struct str9xpec_flash_controller *str9xpec_info = NULL;
 
-       if (argc < 2)
+       if (CMD_ARGC < 2)
        {
                command_print(cmd_ctx, "str9xpec options_lvdwarn <bank> <vdd | vdd_vddq>");
                return ERROR_OK;
@@ -1021,7 +1021,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_options_lvdwarn_command)
 
        str9xpec_info = bank->driver_priv;
 
-       if (strcmp(args[1], "vdd_vddq") == 0)
+       if (strcmp(CMD_ARGV[1], "vdd_vddq") == 0)
        {
                buf_set_u32(str9xpec_info->options, STR9XPEC_OPT_LVDWARNBIT, 1, 1);
        }
@@ -1037,7 +1037,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_lock_command)
 {
        uint8_t status;
 
-       if (argc < 1)
+       if (CMD_ARGC < 1)
        {
                command_print(cmd_ctx, "str9xpec lock <bank>");
                return ERROR_OK;
@@ -1060,7 +1060,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_unlock_command)
 {
        uint8_t status;
 
-       if (argc < 1)
+       if (CMD_ARGC < 1)
        {
                command_print(cmd_ctx, "str9xpec unlock <bank>");
                return ERROR_OK;
@@ -1086,7 +1086,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command)
        struct jtag_tap *tap2;
        struct str9xpec_flash_controller *str9xpec_info = NULL;
 
-       if (argc < 1)
+       if (CMD_ARGC < 1)
        {
                command_print(cmd_ctx, "str9xpec enable_turbo <bank>");
                return ERROR_OK;
@@ -1133,7 +1133,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command)
        struct jtag_tap *tap;
        struct str9xpec_flash_controller *str9xpec_info = NULL;
 
-       if (argc < 1)
+       if (CMD_ARGC < 1)
        {
                command_print(cmd_ctx, "str9xpec disable_turbo <bank>");
                return ERROR_OK;

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)