diff options
Diffstat (limited to 'src/target/openrisc')
-rw-r--r-- | src/target/openrisc/or1k.c | 6 | ||||
-rw-r--r-- | src/target/openrisc/or1k_du_adv.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/target/openrisc/or1k.c b/src/target/openrisc/or1k.c index 5b8d7de..8fbcd96 100644 --- a/src/target/openrisc/or1k.c +++ b/src/target/openrisc/or1k.c @@ -1089,12 +1089,12 @@ static int or1k_init_target(struct command_context *cmd_ctx, struct or1k_du *du_core = or1k_to_du(or1k); struct or1k_jtag *jtag = &or1k->jtag; - if (du_core == NULL) { + if (!du_core) { LOG_ERROR("No debug unit selected"); return ERROR_FAIL; } - if (jtag->tap_ip == NULL) { + if (!jtag->tap_ip) { LOG_ERROR("No tap selected"); return ERROR_FAIL; } @@ -1111,7 +1111,7 @@ static int or1k_init_target(struct command_context *cmd_ctx, static int or1k_target_create(struct target *target, Jim_Interp *interp) { - if (target->tap == NULL) + if (!target->tap) return ERROR_FAIL; struct or1k_common *or1k = calloc(1, sizeof(struct or1k_common)); diff --git a/src/target/openrisc/or1k_du_adv.c b/src/target/openrisc/or1k_du_adv.c index 31b2487..885fcb9 100644 --- a/src/target/openrisc/or1k_du_adv.c +++ b/src/target/openrisc/or1k_du_adv.c @@ -946,7 +946,7 @@ static int or1k_adv_jtag_write_memory(struct or1k_jtag *jtag_info, struct target *target = jtag_info->target; if ((target->endianness == TARGET_BIG_ENDIAN) && (size != 1)) { t = malloc(count * size * sizeof(uint8_t)); - if (t == NULL) { + if (!t) { LOG_ERROR("Out of memory"); return ERROR_FAIL; } |