openocd: remove NULL comparisons with checkpatch [1/2]
Patch generated automatically through the new checkpatch with flags "--types COMPARISON_TO_NULL --fix-inplace". This only fixes the comparisons if (symbol == NULL) if (symbol != NULL) The case of NULL on the left side of the comparison is not tested. Some automatic fix is incorrect and has been massaged by hands: - if (*psig == NULL) + if (*!psig) changed as + if (!*psig) Change-Id: If4a1e2b4e547e223532e8e3d9da89bf9cb382ce6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6351 Tested-by: jenkins
This commit is contained in:
@@ -2053,7 +2053,7 @@ int riscv_openocd_poll(struct target *target)
|
||||
unsigned should_remain_halted = 0;
|
||||
unsigned should_resume = 0;
|
||||
unsigned i = 0;
|
||||
for (struct target_list *list = target->head; list != NULL;
|
||||
for (struct target_list *list = target->head; list;
|
||||
list = list->next, i++) {
|
||||
total_targets++;
|
||||
struct target *t = list->target;
|
||||
@@ -3059,7 +3059,7 @@ int riscv_count_harts(struct target *target)
|
||||
if (!target)
|
||||
return 1;
|
||||
RISCV_INFO(r);
|
||||
if (r == NULL || r->hart_count == NULL)
|
||||
if (!r || !r->hart_count)
|
||||
return 1;
|
||||
return r->hart_count(target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user