aboutsummaryrefslogtreecommitdiff
path: root/src/rtos
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2021-07-03 21:47:55 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-07-24 10:38:11 +0100
commit0a1f904707fa3c170032dd9dba8f2ef9207ff9b2 (patch)
tree485f649bde910405a08e1fd1ca8295aea078d80b /src/rtos
parent391782318723915bd259eadf9469251c13c8fa9c (diff)
downloadriscv-openocd-0a1f904707fa3c170032dd9dba8f2ef9207ff9b2.zip
riscv-openocd-0a1f904707fa3c170032dd9dba8f2ef9207ff9b2.tar.gz
riscv-openocd-0a1f904707fa3c170032dd9dba8f2ef9207ff9b2.tar.bz2
openocd: remove NULL comparisons with checkpatch [2/2]
Patch generated automatically through a modified checkpatch that detects the patterns if (NULL == symbol) if (NULL != symbol) and through flags "--types COMPARISON_TO_NULL --fix-inplace". The unmodified checkpatch detects this pattern as Yoda condition, but it's odd fixing it as Yoda condition and then again as NULL comparison. This triggered the modification to the script. Change-Id: I5fe984a85e9c4fc799f049211797aef891ebce18 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6352 Tested-by: jenkins
Diffstat (limited to 'src/rtos')
-rw-r--r--src/rtos/mqx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rtos/mqx.c b/src/rtos/mqx.c
index 710436b..777d23c 100644
--- a/src/rtos/mqx.c
+++ b/src/rtos/mqx.c
@@ -393,7 +393,7 @@ static int mqx_update_threads(
rtos->thread_details[i].exists = true;
/* set thread name */
rtos->thread_details[i].thread_name_str = malloc(strlen((void *)task_name) + 1);
- if (NULL == rtos->thread_details[i].thread_name_str)
+ if (!rtos->thread_details[i].thread_name_str)
return ERROR_FAIL;
strcpy(rtos->thread_details[i].thread_name_str, (void *)task_name);
/* set thread extra info
@@ -405,7 +405,7 @@ static int mqx_update_threads(
*/
extra_info_length += strlen((void *)state_name) + 7 + 13 + 8 + 15 + 8;
rtos->thread_details[i].extra_info_str = malloc(extra_info_length + 1);
- if (NULL == rtos->thread_details[i].extra_info_str)
+ if (!rtos->thread_details[i].extra_info_str)
return ERROR_FAIL;
snprintf(rtos->thread_details[i].extra_info_str, extra_info_length,
"State: %s, Address: 0x%" PRIx32 ", Error Code: %" PRIu32,
@@ -501,7 +501,7 @@ static int mqx_get_thread_reg_list(
static int mqx_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
*symbol_list = calloc(ARRAY_SIZE(mqx_symbol_list), sizeof(struct symbol_table_elem));
- if (NULL == *symbol_list)
+ if (!*symbol_list)
return ERROR_FAIL;
/* export required symbols */
for (int i = 0; i < (int)(ARRAY_SIZE(mqx_symbol_list)); i++)