diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2021-09-04 23:01:09 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-09-18 15:22:30 +0000 |
commit | 79800db98a985bcd601e8a892aed76d96548a51b (patch) | |
tree | 2250fd09d5be8834fe9c8e0ec513134758ccd971 /src/rtos/rtos.c | |
parent | ea562985b5eff536feea022b074122b21c3610ea (diff) | |
download | riscv-openocd-79800db98a985bcd601e8a892aed76d96548a51b.zip riscv-openocd-79800db98a985bcd601e8a892aed76d96548a51b.tar.gz riscv-openocd-79800db98a985bcd601e8a892aed76d96548a51b.tar.bz2 |
openocd: remove last NULL comparisons
The NULL pointers preceded by cast where not detected by the
scripting tools looking for NULL pointer comparison.
Remove them and, while there, further simplify the code and apply
the other coding style rules.
Change-Id: Ia7406122e07ef56ef311579ab0ee7ddb22c8e4b5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6539
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Diffstat (limited to 'src/rtos/rtos.c')
-rw-r--r-- | src/rtos/rtos.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 0e747e3..eaad5e5 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -234,7 +234,7 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s uint64_t addr = 0; size_t reply_len; char reply[GDB_BUFFER_SIZE + 1], cur_sym[GDB_BUFFER_SIZE / 2 + 1] = ""; /* Extra byte for null-termination */ - struct symbol_table_elem *next_sym = NULL; + struct symbol_table_elem *next_sym; struct target *target = get_target_from_connection(connection); struct rtos *os = target->rtos; @@ -272,7 +272,7 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s next_sym = next_symbol(os, cur_sym, addr); /* Should never happen unless the debugger misbehaves */ - if (next_sym == NULL) { + if (!next_sym) { LOG_WARNING("RTOS: Debugger sent us qSymbol with '%s' that we did not ask for", cur_sym); goto done; } |