diff options
Diffstat (limited to 'src/target/riscv')
-rw-r--r-- | src/target/riscv/riscv-013.c | 2 | ||||
-rw-r--r-- | src/target/riscv/riscv.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index b93e549..24fb79c 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -4409,7 +4409,7 @@ void riscv013_clear_abstract_error(struct target *target) #define COMPLIANCE_TEST(b, message) \ { \ const char *last_sep = strrchr(__FILE__, FILE_SEP); \ - const char *fname = (last_sep == NULL ? __FILE__ : last_sep + 1); \ + const char *fname = (!last_sep ? __FILE__ : last_sep + 1); \ LOG_INFO("Executing test %d (%s:%d): %s", total_tests, fname, __LINE__, message); \ int pass = 0; \ if (b) { \ diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 74d59d2..8f1f398 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -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); } |