|
From: openocd-gerrit <ope...@us...> - 2026-07-04 17:51:10
|
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 a7750b901de7809020cce6449e3ae22735f0c910 (commit)
via 95c5a5268ad0459b351fdd3580755d4bf119f5ec (commit)
from b1a6190740a285ac9c88cc924e459a20a0c4d337 (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 a7750b901de7809020cce6449e3ae22735f0c910
Author: Antonio Borneo <bor...@gm...>
Date: Thu Jun 11 17:58:11 2026 +0200
jtag: check tap_state_by_name() return value against TAP_INVALID
The return value of tap_state_by_name() is an enum tap_state.
Don't compare it with zero to check if it's not valid but use the
enum's value TAP_INVALID.
Change-Id: I185a86a71f6ddbd4e28aca329552dfb94aee5b57
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9740
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <eu...@gm...>
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index 90d6799ab..96066c5af 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -130,7 +130,7 @@ COMMAND_HANDLER(handle_jtag_command_drscan)
if (CMD_ARGC > 3 && !strcmp("-endstate", CMD_ARGV[CMD_ARGC - 2])) {
const char *state_name = CMD_ARGV[CMD_ARGC - 1];
endstate = tap_state_by_name(state_name);
- if (endstate < 0) {
+ if (endstate == TAP_INVALID) {
command_print(CMD, "endstate: %s invalid", state_name);
return ERROR_COMMAND_ARGUMENT_INVALID;
}
@@ -183,7 +183,7 @@ COMMAND_HANDLER(handle_jtag_command_pathmove)
for (unsigned int i = 0; i < CMD_ARGC; i++) {
states[i] = tap_state_by_name(CMD_ARGV[i]);
- if (states[i] < 0) {
+ if (states[i] == TAP_INVALID) {
command_print(CMD, "endstate: %s invalid", CMD_ARGV[i]);
return ERROR_COMMAND_ARGUMENT_INVALID;
}
commit 95c5a5268ad0459b351fdd3580755d4bf119f5ec
Author: Antonio Borneo <bor...@gm...>
Date: Thu Jun 11 17:05:28 2026 +0200
jtag: core: quit jtag_add_pathmove() if nothing to do
If jtag_add_pathmove() is called with num_states set to zero it
means there is nothing to do.
Check num_states and quit if it is zero.
Change-Id: I254a6f84c57d52ca50bfb911d572346a8b10ee3c
Signed-off-by: Antonio Borneo <bor...@gm...>
Reported-by: Evgeniy Naydanov <eu...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9739
Reviewed-by: Evgeniy Naydanov <eu...@gm...>
Tested-by: jenkins
diff --git a/src/jtag/core.c b/src/jtag/core.c
index 08228c024..7e7b84d6d 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -519,6 +519,10 @@ void jtag_add_pathmove(unsigned int num_states, const enum tap_state *path)
{
enum tap_state cur_state = cmd_queue_cur_state;
+ // quit if there is nothing to do
+ if (num_states == 0)
+ return;
+
/* the last state has to be a stable state */
if (!tap_is_state_stable(path[num_states - 1])) {
LOG_ERROR("BUG: TAP path doesn't finish in a stable state");
-----------------------------------------------------------------------
Summary of changes:
src/jtag/core.c | 4 ++++
src/jtag/tcl.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|