flash/nor: add support for Nuvoton NPCX series flash
[fw/openocd] / src / flash / nor / tcl.c
index d7466501782d5311066e451dd6e2f0189af804d8..cbc64dcc40e0c36f23eacbc7afbacc3aa11ec6f6 100644 (file)
@@ -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;