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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user