aboutsummaryrefslogtreecommitdiff
path: root/src/jtag/core.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2021-07-03 21:29:32 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-07-24 10:38:00 +0100
commit391782318723915bd259eadf9469251c13c8fa9c (patch)
treedf5fe28d94e46fd98bf54f47152034db5696f5da /src/jtag/core.c
parent08ee7bb982b16742f52cfdc6c649d82ffa2eb177 (diff)
downloadriscv-openocd-391782318723915bd259eadf9469251c13c8fa9c.zip
riscv-openocd-391782318723915bd259eadf9469251c13c8fa9c.tar.gz
riscv-openocd-391782318723915bd259eadf9469251c13c8fa9c.tar.bz2
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
Diffstat (limited to 'src/jtag/core.c')
-rw-r--r--src/jtag/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c
index 3d63fdd..51c1228 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -218,7 +218,7 @@ static void jtag_tap_add(struct jtag_tap *t)
unsigned jtag_num_taps = 0;
struct jtag_tap **tap = &__jtag_all_taps;
- while (*tap != NULL) {
+ while (*tap) {
jtag_num_taps++;
tap = &(*tap)->next_tap;
}
@@ -429,7 +429,7 @@ static void jtag_add_scan_check(struct jtag_tap *active, void (*jtag_add_scan)(
jtag_add_scan(active, in_num_fields, in_fields, state);
for (int i = 0; i < in_num_fields; i++) {
- if ((in_fields[i].check_value != NULL) && (in_fields[i].in_value != NULL)) {
+ if ((in_fields[i].check_value) && (in_fields[i].in_value)) {
jtag_add_callback4(jtag_check_value_mask_callback,
(jtag_callback_data_t)in_fields[i].in_value,
(jtag_callback_data_t)in_fields[i].check_value,