X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fefm32.c;h=c8ce90866e6c94c0c4cfd1153d936f4a5e8084a4;hb=08ee7bb982b16742f52cfdc6c649d82ffa2eb177;hp=f461956c10d242298a876118bc26f3a189219fc3;hpb=b159f5cdedd70fff9309722e927be670845f4df5;p=openocd.git diff --git a/src/flash/nor/efm32.c b/src/flash/nor/efm32.c index f461956c10..c8ce90866e 100644 --- a/src/flash/nor/efm32.c +++ b/src/flash/nor/efm32.c @@ -271,7 +271,7 @@ static int efm32x_read_info(struct flash_bank *bank, efm32_info->family_data = &efm32_families[i]; } - if (efm32_info->family_data == NULL) { + if (!efm32_info->family_data) { LOG_ERROR("Unknown MCU family %d", efm32_info->part_family); return ERROR_FAIL; } @@ -885,7 +885,7 @@ static int efm32x_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t old_count = count; count = (old_count | 3) + 1; new_buffer = malloc(count); - if (new_buffer == NULL) { + if (!new_buffer) { LOG_ERROR("odd number of bytes to write and no memory " "for padding buffer"); return ERROR_FAIL; @@ -1016,7 +1016,7 @@ static int efm32x_protect_check(struct flash_bank *bank) return ret; } - assert(NULL != bank->sectors); + assert(bank->sectors); for (unsigned int i = 0; i < bank->num_sectors; i++) bank->sectors[i].is_protected = efm32x_get_page_lock(bank, i);