flash/stm32l4x: fix dual bank support for STM32L552xC devices
[openocd.git] / src / target / xscale.c
index aaaed0ebb2d0cfc0b7fd8987bbf26c617df66c8d..dd383b6e46d50ef831ab23562d637ca09df9411e 100644 (file)
@@ -150,7 +150,7 @@ static int xscale_verify_pointer(struct command_invocation *cmd,
 
 static int xscale_jtag_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state)
 {
-       assert(tap != NULL);
+       assert(tap);
 
        if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr) {
                struct scan_field field;
@@ -1158,7 +1158,7 @@ static int xscale_resume(struct target *target, int current,
                struct breakpoint *breakpoint;
                breakpoint = breakpoint_find(target,
                                buf_get_u32(arm->pc->value, 0, 32));
-               if (breakpoint != NULL) {
+               if (breakpoint) {
                        uint32_t next_pc;
                        enum trace_mode saved_trace_mode;
 
@@ -1421,7 +1421,7 @@ static int xscale_step(struct target *target, int current,
        if (handle_breakpoints)
                breakpoint = breakpoint_find(target,
                                buf_get_u32(arm->pc->value, 0, 32));
-       if (breakpoint != NULL) {
+       if (breakpoint) {
                retval = xscale_unset_breakpoint(target, breakpoint);
                if (retval != ERROR_OK)
                        return retval;
@@ -2882,7 +2882,7 @@ static void xscale_build_reg_cache(struct target *target)
        /* fill in values for the xscale reg cache */
        (*cache_p)->name = "XScale registers";
        (*cache_p)->next = NULL;
-       (*cache_p)->reg_list = malloc(num_regs * sizeof(struct reg));
+       (*cache_p)->reg_list = calloc(num_regs, sizeof(struct reg));
        (*cache_p)->num_regs = num_regs;
 
        for (i = 0; i < num_regs; i++) {
@@ -3048,7 +3048,7 @@ COMMAND_HANDLER(xscale_handle_debug_handler_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        target = get_target(CMD_ARGV[0]);
-       if (target == NULL) {
+       if (!target) {
                LOG_ERROR("target '%s' not defined", CMD_ARGV[0]);
                return ERROR_FAIL;
        }
@@ -3083,7 +3083,7 @@ COMMAND_HANDLER(xscale_handle_cache_clean_address_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        target = get_target(CMD_ARGV[0]);
-       if (target == NULL) {
+       if (!target) {
                LOG_ERROR("target '%s' not defined", CMD_ARGV[0]);
                return ERROR_FAIL;
        }

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)