|
From: openocd-gerrit <ope...@us...> - 2026-04-06 16:24:26
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 48f57a72cec23c03321452ed696eff5763bbe251 (commit)
via b8cfd063683cec565aa137ca4b754182eacb72e9 (commit)
from 231aa88ee5170f28c3a6f9c2bd3055ba7f242c99 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 48f57a72cec23c03321452ed696eff5763bbe251
Author: Mark O'Donovan <sh...@po...>
Date: Tue Feb 24 21:55:37 2026 +0000
target/dsp5680xx: cleanup code confusing cppcheck
1. Add check of target pointer in dsp5680xx_irscan().
2. Replace some calls to err_check().
The calls to err_check() were confusing cppcheck.
The changes are not strictly required but I think they are more
readable.
Change-Id: I9c144143254c8e153cc7848094994ea9f769f4ff
Signed-off-by: Mark O'Donovan <sh...@po...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9504
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c
index 65efbae32..7f2b40edf 100644
--- a/src/target/dsp5680xx.c
+++ b/src/target/dsp5680xx.c
@@ -19,6 +19,7 @@
static struct dsp5680xx_common dsp5680xx_context;
#define _E "DSP5680XX_ERROR:%d\nAt:%s:%d:%s"
+#define err_log(c, m) LOG_ERROR(_E, c, __func__, __LINE__, m)
#define err_check(r, c, m) if (r != ERROR_OK) {LOG_ERROR(_E, c, __func__, __LINE__, m); return r; }
#define err_check_propagate(retval) if (retval != ERROR_OK) return retval;
#define DEBUG_MSG "Debug mode be enabled to read mem."
@@ -116,10 +117,9 @@ static int dsp5680xx_irscan(struct target *target, uint32_t *d_in,
uint16_t tap_ir_len = DSP5680XX_JTAG_MASTER_TAP_IRLEN;
- if (!target->tap) {
- retval = ERROR_FAIL;
- err_check(retval, DSP5680XX_ERROR_JTAG_INVALID_TAP,
- "Invalid tap");
+ if (!target || !target->tap) {
+ err_log(DSP5680XX_ERROR_JTAG_INVALID_TAP, "Invalid tap");
+ return ERROR_FAIL;
}
if (ir_len != target->tap->ir_length) {
if (target->tap->enabled) {
@@ -579,9 +579,9 @@ static int switch_tap(struct target *target, struct jtag_tap *master_tap,
if (!core_tap) {
core_tap = jtag_tap_by_string("dsp568013.cpu");
if (!core_tap) {
- retval = ERROR_FAIL;
- err_check(retval, DSP5680XX_ERROR_JTAG_TAP_FIND_CORE,
+ err_log(DSP5680XX_ERROR_JTAG_TAP_FIND_CORE,
"Failed to get core tap.");
+ return ERROR_FAIL;
}
}
@@ -727,9 +727,9 @@ static int eonce_enter_debug_mode(struct target *target,
}
tap_cpu = jtag_tap_by_string("dsp568013.cpu");
if (!tap_cpu) {
- retval = ERROR_FAIL;
- err_check(retval, DSP5680XX_ERROR_JTAG_TAP_FIND_CORE,
+ err_log(DSP5680XX_ERROR_JTAG_TAP_FIND_CORE,
"Failed to get master tap.");
+ return ERROR_FAIL;
}
/* Enable master tap */
tap_chp->enabled = true;
@@ -2222,9 +2222,9 @@ int dsp5680xx_f_lock(struct target *target)
}
tap_cpu = jtag_tap_by_string("dsp568013.cpu");
if (!tap_cpu) {
- retval = ERROR_FAIL;
- err_check(retval, DSP5680XX_ERROR_JTAG_TAP_ENABLE_CORE,
+ err_log(DSP5680XX_ERROR_JTAG_TAP_ENABLE_CORE,
"Failed to get master tap.");
+ return ERROR_FAIL;
}
target->state = TARGET_RUNNING;
dsp5680xx_context.debug_mode_enabled = false;
@@ -2237,8 +2237,9 @@ int dsp5680xx_f_lock(struct target *target)
static int dsp5680xx_step(struct target *target, bool current, target_addr_t address,
bool handle_breakpoints)
{
- err_check(ERROR_FAIL, DSP5680XX_ERROR_NOT_IMPLEMENTED_STEP,
+ err_log(DSP5680XX_ERROR_NOT_IMPLEMENTED_STEP,
"Not implemented yet.");
+ return ERROR_FAIL;
}
/** Holds methods for dsp5680xx targets. */
commit b8cfd063683cec565aa137ca4b754182eacb72e9
Author: Mark O'Donovan <sh...@po...>
Date: Tue Feb 24 20:49:50 2026 +0000
target/semihosting_common: remove redundant NULL check
The value semihosting can never be NULL here.
Found by cppcheck.
Change-Id: Iff5cef0ffc78ec19bc7630bc2cc9bc4eea002e47
Signed-off-by: Mark O'Donovan <sh...@po...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9503
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/target/semihosting_common.c b/src/target/semihosting_common.c
index 345e542c3..bcf37b6ad 100644
--- a/src/target/semihosting_common.c
+++ b/src/target/semihosting_common.c
@@ -1857,7 +1857,7 @@ COMMAND_HANDLER(handle_common_semihosting_command)
return ERROR_FAIL;
}
- if (semihosting && semihosting->setup(target, is_active) != ERROR_OK) {
+ if (semihosting->setup(target, is_active) != ERROR_OK) {
LOG_ERROR("Failed to Configure semihosting");
return ERROR_FAIL;
}
-----------------------------------------------------------------------
Summary of changes:
src/target/dsp5680xx.c | 23 ++++++++++++-----------
src/target/semihosting_common.c | 2 +-
2 files changed, 13 insertions(+), 12 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|