X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Ftcl.c;h=cbc64dcc40e0c36f23eacbc7afbacc3aa11ec6f6;hb=385eedfc6f0b82c5d6715c740ee40bdce983ef04;hp=d7466501782d5311066e451dd6e2f0189af804d8;hpb=08ee7bb982b16742f52cfdc6c649d82ffa2eb177;p=fw%2Fopenocd diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index d74665017..cbc64dcc4 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -99,7 +99,7 @@ COMMAND_HANDLER(handle_flash_info_command) /* If the driver does not implement protection, we show the default * state of is_protected array - usually protection state unknown */ - if (p->driver->protect_check == NULL) { + if (!p->driver->protect_check) { retval = ERROR_FLASH_OPER_UNSUPPORTED; } else { /* We must query the hardware to avoid printing stale information! */ @@ -148,7 +148,7 @@ COMMAND_HANDLER(handle_flash_info_command) protect_state); } - if (p->driver->info != NULL) { + if (p->driver->info) { /* Let the flash driver print extra custom info */ retval = p->driver->info(p, CMD); command_print_sameline(CMD, "\n"); @@ -1276,7 +1276,7 @@ COMMAND_HANDLER(handle_flash_bank_command) } /* check the flash bank name is unique */ - if (get_flash_bank_by_name_noprobe(bank_name) != NULL) { + if (get_flash_bank_by_name_noprobe(bank_name)) { /* flash bank name already exists */ LOG_ERROR("flash bank name '%s' already exists", bank_name); return ERROR_FAIL;