diff options
Diffstat (limited to 'src/target/mips_m4k.c')
-rw-r--r-- | src/target/mips_m4k.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index 8fa4309..1a40293 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -1045,7 +1045,7 @@ static int mips_m4k_read_memory(struct target *target, target_addr_t address, if (size > 1) { t = malloc(count * size * sizeof(uint8_t)); - if (t == NULL) { + if (!t) { LOG_ERROR("Out of memory"); return ERROR_FAIL; } @@ -1112,7 +1112,7 @@ static int mips_m4k_write_memory(struct target *target, target_addr_t address, /* mips32_..._write_mem with size 4/2 requires uint32_t/uint16_t in host */ /* endianness, but byte array represents target endianness */ t = malloc(count * size * sizeof(uint8_t)); - if (t == NULL) { + if (!t) { LOG_ERROR("Out of memory"); return ERROR_FAIL; } @@ -1218,7 +1218,7 @@ static int mips_m4k_bulk_write_memory(struct target *target, target_addr_t addre if (address & 0x3u) return ERROR_TARGET_UNALIGNED_ACCESS; - if (mips32->fast_data_area == NULL) { + if (!mips32->fast_data_area) { /* Get memory for block write handler * we preserve this area between calls and gain a speed increase * of about 3kb/sec when writing flash @@ -1250,7 +1250,7 @@ static int mips_m4k_bulk_write_memory(struct target *target, target_addr_t addre /* but byte array represents target endianness */ uint32_t *t = NULL; t = malloc(count * sizeof(uint32_t)); - if (t == NULL) { + if (!t) { LOG_ERROR("Out of memory"); return ERROR_FAIL; } |