|
From: openocd-gerrit <ope...@us...> - 2023-04-30 14:53:22
|
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 8670ad4caa705c460972badbd0fc28aa98c41866 (commit)
via c1dc7935f78973e89dfe10e5b93238ae3f4eacd3 (commit)
from bb073f897cd37a6253e49c5628a98a59fccf2ea5 (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 8670ad4caa705c460972badbd0fc28aa98c41866
Author: Antonio Borneo <bor...@gm...>
Date: Sat Apr 15 00:25:54 2023 +0200
target/espressif: fix clang report on list use
It looks like a false positive.
Scan-build considers as possible to:
- have list_empty() return false;
- list_for_each_safe() to not execute any loop, thus not assigning
a non-NULL value to 'block';
- the NULL pointer 'block' is passed to list_del().
This is not possible because with list_empty(), the loop runs at
least once.
Rewrite the function to simplify the code and making it easier for
scan-build to check it.
This also drops an incorrect use of list_for_each_safe(), where
the 'safe' version was not required.
Change-Id: Ia8b1d221cf9df73db1196e3f51986023dcaf78eb
Signed-off-by: Antonio Borneo <bor...@gm...>
Fixes: 8d1dcf293a0c ("target/espressif: add application tracing functionality over JTAG")
Reviewed-on: https://review.openocd.org/c/openocd/+/7608
Reviewed-by: Erhan Kurubas <erh...@es...>
Tested-by: jenkins
diff --git a/src/target/espressif/esp32_apptrace.c b/src/target/espressif/esp32_apptrace.c
index dfeb79401..291503e53 100644
--- a/src/target/espressif/esp32_apptrace.c
+++ b/src/target/espressif/esp32_apptrace.c
@@ -356,18 +356,14 @@ static int esp32_apptrace_ready_block_put(struct esp32_apptrace_cmd_ctx *ctx, st
static struct esp32_apptrace_block *esp32_apptrace_ready_block_get(struct esp32_apptrace_cmd_ctx *ctx)
{
- struct esp32_apptrace_block *block = NULL;
+ if (list_empty(&ctx->ready_trace_blocks))
+ return NULL;
- if (!list_empty(&ctx->ready_trace_blocks)) {
- struct list_head *head = &ctx->ready_trace_blocks;
- struct list_head *tmp, *pos;
+ struct esp32_apptrace_block *block =
+ list_last_entry(&ctx->ready_trace_blocks, struct esp32_apptrace_block, node);
- list_for_each_safe(pos, tmp, head) {
- block = list_entry(pos, struct esp32_apptrace_block, node);
- }
- /* remove it from ready list */
- list_del(&block->node);
- }
+ /* remove it from ready list */
+ list_del(&block->node);
return block;
}
commit c1dc7935f78973e89dfe10e5b93238ae3f4eacd3
Author: Antonio Borneo <bor...@gm...>
Date: Sat Apr 15 00:21:42 2023 +0200
target/espressif: fix clang report on use of garbage value
When the function xtensa_queue_dbg_reg_read() returns error, the
array 'tmp' remains not initialized and scan-build complains while
computing buf_get_u32() that:
Result of operation is garbage or undefined
Check the returned value of xtensa_queue_dbg_reg_read() and
propagate it.
Change-Id: If0aaad068b97ef0a76560e262d16429afd469585
Signed-off-by: Antonio Borneo <bor...@gm...>
Fixes: 8d1dcf293a0c ("target/espressif: add application tracing functionality over JTAG")
Reviewed-on: https://review.openocd.org/c/openocd/+/7607
Tested-by: jenkins
Reviewed-by: Erhan Kurubas <erh...@es...>
diff --git a/src/target/espressif/esp_xtensa_apptrace.c b/src/target/espressif/esp_xtensa_apptrace.c
index dfb846da0..5741ab030 100644
--- a/src/target/espressif/esp_xtensa_apptrace.c
+++ b/src/target/espressif/esp_xtensa_apptrace.c
@@ -242,9 +242,11 @@ int esp_xtensa_apptrace_status_reg_read(struct target *target, uint32_t *stat)
struct xtensa *xtensa = target_to_xtensa(target);
uint8_t tmp[4];
- xtensa_queue_dbg_reg_read(xtensa, XTENSA_APPTRACE_STAT_REG, tmp);
+ int res = xtensa_queue_dbg_reg_read(xtensa, XTENSA_APPTRACE_STAT_REG, tmp);
+ if (res != ERROR_OK)
+ return res;
xtensa_dm_queue_tdi_idle(&xtensa->dbg_mod);
- int res = xtensa_dm_queue_execute(&xtensa->dbg_mod);
+ res = xtensa_dm_queue_execute(&xtensa->dbg_mod);
if (res != ERROR_OK) {
LOG_ERROR("Failed to exec JTAG queue!");
return res;
-----------------------------------------------------------------------
Summary of changes:
src/target/espressif/esp32_apptrace.c | 16 ++++++----------
src/target/espressif/esp_xtensa_apptrace.c | 6 ++++--
2 files changed, 10 insertions(+), 12 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|