diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2023-04-09 00:33:38 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2023-05-05 22:09:24 +0000 |
commit | 314f4c665f746ebec3be69a8e26f0a671cfdcb46 (patch) | |
tree | d5d58bb64a3847dc5c56b5f46bcb1326c47fd902 /src | |
parent | cd44c6cf83841076b40e7a873285117b7440dd42 (diff) | |
download | riscv-openocd-314f4c665f746ebec3be69a8e26f0a671cfdcb46.zip riscv-openocd-314f4c665f746ebec3be69a8e26f0a671cfdcb46.tar.gz riscv-openocd-314f4c665f746ebec3be69a8e26f0a671cfdcb46.tar.bz2 |
rtos: with pointers, use NULL instead of 0
Don't compare pointers with 0, use NULL when needed.
Don't assign pointer to 0, use NULL.
Detected through 'sparse' tool.
Change-Id: Ifa81ba961c0d490cc74880b4a46b620e6358f779
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7598
Tested-by: jenkins
Diffstat (limited to 'src')
-rw-r--r-- | src/rtos/chibios.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rtos/chibios.c b/src/rtos/chibios.c index 68fe8a1..2037827 100644 --- a/src/rtos/chibios.c +++ b/src/rtos/chibios.c @@ -80,12 +80,12 @@ struct chibios_params { static struct chibios_params chibios_params_list[] = { { "cortex_m", /* target_name */ - 0, + NULL, NULL, /* stacking_info */ }, { "hla_target", /* target_name */ - 0, + NULL, NULL, /* stacking_info */ } }; @@ -198,7 +198,7 @@ static int chibios_update_memory_signature(struct rtos *rtos) errfree: /* Error reading the ChibiOS memory structure */ free(signature); - param->signature = 0; + param->signature = NULL; return -1; } @@ -468,7 +468,7 @@ static int chibios_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, return -1; /* Update stacking if it can only be determined from runtime information */ - if ((param->stacking_info == 0) && + if (!param->stacking_info && (chibios_update_stacking(rtos) != ERROR_OK)) { LOG_ERROR("Failed to determine exact stacking for the target type %s", rtos->target->type->name); return -1; |