aboutsummaryrefslogtreecommitdiff
path: root/src/server
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/server
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/server')
-rw-r--r--src/server/gdb_server.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 3a39f8a..015baa1 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -1212,7 +1212,7 @@ static int gdb_get_registers_packet(struct connection *connection,
LOG_DEBUG("-");
#endif
- if ((target->rtos) && (ERROR_OK == rtos_get_gdb_reg_list(connection)))
+ if ((target->rtos) && (rtos_get_gdb_reg_list(connection) == ERROR_OK))
return ERROR_OK;
retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size,
@@ -1342,7 +1342,7 @@ static int gdb_get_register_packet(struct connection *connection,
LOG_DEBUG("-");
#endif
- if ((target->rtos) && (ERROR_OK == rtos_get_gdb_reg(connection, reg_num)))
+ if ((target->rtos) && (rtos_get_gdb_reg(connection, reg_num) == ERROR_OK))
return ERROR_OK;
retval = target_get_gdb_reg_list_noread(target, &reg_list, &reg_list_size,
@@ -1399,7 +1399,7 @@ static int gdb_set_register_packet(struct connection *connection,
gdb_target_to_reg(target, separator + 1, chars, bin_buf);
if ((target->rtos) &&
- (ERROR_OK == rtos_set_reg(connection, reg_num, bin_buf))) {
+ (rtos_set_reg(connection, reg_num, bin_buf) == ERROR_OK)) {
free(bin_buf);
gdb_put_packet(connection, "OK", 2);
return ERROR_OK;