aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/mqx.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2021-07-03 17:18:53 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-07-24 10:38:31 +0100
commitc0c7d6fe8b04f521a7262303083ef5eb6ebaf4e5 (patch)
treeceb6cb092f7bbf31a9ca0677c6a67364d4a52ed2 /src/rtos/mqx.c
parent54e699b2601036e384a124657aa1fbdd9ff2dc87 (diff)
downloadriscv-openocd-c0c7d6fe8b04f521a7262303083ef5eb6ebaf4e5.zip
riscv-openocd-c0c7d6fe8b04f521a7262303083ef5eb6ebaf4e5.tar.gz
riscv-openocd-c0c7d6fe8b04f521a7262303083ef5eb6ebaf4e5.tar.bz2
openocd: fix Yoda conditions with checkpatch
The new checkpatch can automatically fix the code, but this feature is still error prone and not complete. Patch generated automatically through the new checkpatch with flags "--types CONSTANT_COMPARISON --fix-inplace". Some Yoda condition is detected by checkpatch but not fixed; it will be fixed manually in a following commit. Change-Id: Ifaaa1159e63dbd1db6aa3c017125df9874fa9703 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6355 Tested-by: jenkins
Diffstat (limited to 'src/rtos/mqx.c')
-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 777d23c..754470e 100644
--- a/src/rtos/mqx.c
+++ b/src/rtos/mqx.c
@@ -260,7 +260,7 @@ static int mqx_create(
{
/* check target name against supported architectures */
for (unsigned int i = 0; i < ARRAY_SIZE(mqx_params_list); i++) {
- if (0 == strcmp(mqx_params_list[i].target_name, target->type->name)) {
+ if (strcmp(mqx_params_list[i].target_name, target->type->name) == 0) {
target->rtos->rtos_specific_params = (void *)&mqx_params_list[i];
/* LOG_DEBUG("MQX RTOS - valid architecture: %s", target->type->name); */
return 0;
@@ -291,7 +291,7 @@ static int mqx_update_threads(
/* clear old data */
rtos_free_threadlist(rtos);
/* check scheduler */
- if (ERROR_OK != mqx_is_scheduler_running(rtos))
+ if (mqx_is_scheduler_running(rtos) != ERROR_OK)
return ERROR_FAIL;
/* get kernel_data symbol */
if (mqx_get_symbol(rtos, MQX_VAL_MQX_KERNEL_DATA, &kernel_data_addr) != ERROR_OK)
@@ -438,7 +438,7 @@ static int mqx_get_thread_reg_list(
LOG_ERROR("MQX RTOS - invalid threadid: 0x%X", (int)thread_id);
return ERROR_FAIL;
}
- if (ERROR_OK != mqx_is_scheduler_running(rtos))
+ if (mqx_is_scheduler_running(rtos) != ERROR_OK)
return ERROR_FAIL;
/* get kernel_data symbol */
if (mqx_get_symbol(rtos, MQX_VAL_MQX_KERNEL_DATA, &kernel_data_addr) != ERROR_OK)