forked from auracaster/openocd
OpenOCD: drop comparison with true/false
Fix checkpatch errors: ERROR:BOOL_COMPARISON: Using comparison to true/false is error prone While there, - drop useless parenthesis, - drop unnecessary else after a return. Change-Id: I1234737b3e65bd10df5e938d1c36f9abaf02d348 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8496 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
This commit is contained in:
@@ -1262,7 +1262,7 @@ static int gdb_get_registers_packet(struct connection *connection,
|
||||
return gdb_error(connection, retval);
|
||||
|
||||
for (i = 0; i < reg_list_size; i++) {
|
||||
if (!reg_list[i] || reg_list[i]->exist == false || reg_list[i]->hidden)
|
||||
if (!reg_list[i] || !reg_list[i]->exist || reg_list[i]->hidden)
|
||||
continue;
|
||||
reg_packet_size += DIV_ROUND_UP(reg_list[i]->size, 8) * 2;
|
||||
}
|
||||
@@ -1276,7 +1276,7 @@ static int gdb_get_registers_packet(struct connection *connection,
|
||||
reg_packet_p = reg_packet;
|
||||
|
||||
for (i = 0; i < reg_list_size; i++) {
|
||||
if (!reg_list[i] || reg_list[i]->exist == false || reg_list[i]->hidden)
|
||||
if (!reg_list[i] || !reg_list[i]->exist || reg_list[i]->hidden)
|
||||
continue;
|
||||
retval = gdb_get_reg_value_as_str(target, reg_packet_p, reg_list[i]);
|
||||
if (retval != ERROR_OK && gdb_report_register_access_error) {
|
||||
@@ -2254,7 +2254,7 @@ static int get_reg_features_list(struct target *target, char const **feature_lis
|
||||
*feature_list = calloc(1, sizeof(char *));
|
||||
|
||||
for (int i = 0; i < reg_list_size; i++) {
|
||||
if (reg_list[i]->exist == false || reg_list[i]->hidden)
|
||||
if (!reg_list[i]->exist || reg_list[i]->hidden)
|
||||
continue;
|
||||
|
||||
if (reg_list[i]->feature
|
||||
@@ -2464,7 +2464,7 @@ static int gdb_generate_target_description(struct target *target, char **tdesc_o
|
||||
int i;
|
||||
for (i = 0; i < reg_list_size; i++) {
|
||||
|
||||
if (reg_list[i]->exist == false || reg_list[i]->hidden)
|
||||
if (!reg_list[i]->exist || reg_list[i]->hidden)
|
||||
continue;
|
||||
|
||||
if (strcmp(reg_list[i]->feature->name, features[current_feature]))
|
||||
|
||||
Reference in New Issue
Block a user