target: drop last instances of 'target->cmd_name'

The helper function 'target_name()' or, better, the log functions
'LOG_TARGET_xxx(target, ...)' should be used in place of taking
the target name directly from 'target->cmd_name'.

Replace the remaining instances in the code.

While there:
- address some indentation,
- drop trailing punctuation in log message,
- replace one LOG WARNING with LOG_TARGET_WARNING.

Change-Id: Ie6cf4c174ffe91b975c983e4697c735766267041
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8806
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
This commit is contained in:
Antonio Borneo
2025-03-16 11:50:04 +01:00
parent 5773ff9d82
commit a86fdfc735
4 changed files with 15 additions and 16 deletions

View File

@@ -649,7 +649,7 @@ static int esp32_apptrace_wait4halt(struct esp32_apptrace_cmd_ctx *ctx, struct t
if (res != ERROR_OK)
return res;
if (target->state == TARGET_HALTED) {
LOG_USER("%s: HALTED", target->cmd_name);
LOG_TARGET_USER(target, "HALTED");
break;
}
alive_sleep(500);

View File

@@ -277,7 +277,7 @@ static int esp_xtensa_swdbg_activate(struct target *target, int enab)
xtensa_dm_queue_tdi_idle(&xtensa->dbg_mod);
int res = xtensa_dm_queue_execute(&xtensa->dbg_mod);
if (res != ERROR_OK) {
LOG_ERROR("%s: writing DCR failed!", target->cmd_name);
LOG_TARGET_ERROR(target, "writing DCR failed");
return res;
}