riscv-openocd/src
Antonio Borneo 8670ad4caa 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 <borneo.antonio@gmail.com>
Fixes: 8d1dcf293a ("target/espressif: add application tracing functionality over JTAG")
Reviewed-on: https://review.openocd.org/c/openocd/+/7608
Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Tested-by: jenkins
2023-04-30 14:52:36 +00:00
..
flash flash/nor: missing fileio_close. 2023-03-28 09:37:51 +00:00
helper helper/compiler fix build with gcc on MacOS 2023-04-07 22:56:27 +00:00
jtag jtag: rewrite command 'flush_count' as COMMAND_HANDLER 2023-03-25 18:13:34 +00:00
pld pld: move file sanity checks to pld.c 2023-04-14 15:18:40 +00:00
rtos rtos/linux.c: Fix Linux user space border check 2023-04-14 15:16:43 +00:00
rtt rtt: rewrite command 'rtt channellist' as COMMAND_HANDLER 2023-03-25 18:11:14 +00:00
server src: fix clang15 compiler warnings 2023-04-30 14:51:42 +00:00
svf svf: make command 'svf' syntax consistent 2023-03-25 18:09:06 +00:00
target target/espressif: fix clang report on list use 2023-04-30 14:52:36 +00:00
transport transport: rewrite command 'transport select' as COMMAND_HANDLER 2023-03-25 18:09:47 +00:00
xsvf openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
Makefile.am openocd: build: add SPDX tag 2022-07-23 13:06:38 +00:00
hello.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
hello.h openocd: src: replace the GPL-2.0-or-later license tag 2022-07-23 13:59:13 +00:00
main.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
openocd.c openocd: rewrite command 'version' as COMMAND_HANDLER 2023-03-25 18:10:54 +00:00
openocd.h openocd: src: replace the GPL-2.0-or-later license tag 2022-07-23 13:59:13 +00:00