aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/sim3x.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/flash/nor/sim3x.c')
-rw-r--r--src/flash/nor/sim3x.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/flash/nor/sim3x.c b/src/flash/nor/sim3x.c
index a84fcf0..20b5e39 100644
--- a/src/flash/nor/sim3x.c
+++ b/src/flash/nor/sim3x.c
@@ -511,7 +511,7 @@ static int sim3x_flash_write(struct flash_bank *bank, const uint8_t *buffer, uin
count++;
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;
@@ -935,7 +935,7 @@ COMMAND_HANDLER(sim3x_mass_erase)
struct cortex_m_common *cortex_m = target_to_cm(target);
struct adiv5_dap *dap = cortex_m->armv7m.arm.dap;
- if (dap == NULL) {
+ if (!dap) {
/* Used debug interface doesn't support direct DAP access */
LOG_ERROR("mass_erase can't be used by this debug interface");
return ERROR_FAIL;
@@ -980,7 +980,7 @@ COMMAND_HANDLER(sim3x_lock)
struct cortex_m_common *cortex_m = target_to_cm(target);
struct adiv5_dap *dap = cortex_m->armv7m.arm.dap;
- if (dap == NULL) {
+ if (!dap) {
/* Used debug interface doesn't support direct DAP access */
LOG_INFO("Target can't by unlocked by this debug interface");
@@ -1052,7 +1052,7 @@ COMMAND_HANDLER(sim3x_lock)
LOG_ERROR("Unexpected lock word value");
/* SIM3X_AP_ID_VALUE is not checked */
- if (dap == NULL)
+ if (!dap)
LOG_INFO("Maybe this isn't a SiM3x MCU");
return ERROR_FAIL;