openocd: remove NULL comparisons with checkpatch [2/2]
[openocd.git] / src / flash / nand / tcl.c
index cbc51b8d1515720dd7e4fb676be6c736b65ebffb..6707314ccc824d3c87caebf02107c8b663aaa57c 100644 (file)
@@ -86,7 +86,7 @@ COMMAND_HANDLER(handle_nand_info_command)
        if (retval != ERROR_OK)
                return retval;
 
-       if (NULL == p->device) {
+       if (!p->device) {
                command_print(CMD, "#%s: not probed", CMD_ARGV[0]);
                return ERROR_OK;
        }
@@ -359,10 +359,10 @@ COMMAND_HANDLER(handle_nand_dump_command)
                        return retval;
                }
 
-               if (NULL != s.page)
+               if (s.page)
                        fileio_write(s.fileio, s.page_size, s.page, &size_written);
 
-               if (NULL != s.oob)
+               if (s.oob)
                        fileio_write(s.fileio, s.oob_size, s.oob, &size_written);
 
                s.size -= nand->page_size;
@@ -391,7 +391,7 @@ COMMAND_HANDLER(handle_nand_raw_access_command)
        if (retval != ERROR_OK)
                return retval;
 
-       if (NULL == p->device) {
+       if (!p->device) {
                command_print(CMD, "#%s: not probed", CMD_ARGV[0]);
                return ERROR_OK;
        }
@@ -527,14 +527,14 @@ static COMMAND_HELPER(create_nand_device, const char *bank_name,
                return ERROR_COMMAND_ARGUMENT_INVALID;
        }
 
-       if (NULL != controller->commands) {
+       if (controller->commands) {
                retval = register_commands(CMD_CTX, NULL,
                                controller->commands);
                if (retval != ERROR_OK)
                        return retval;
        }
        c = malloc(sizeof(struct nand_device));
-       if (c == NULL) {
+       if (!c) {
                LOG_ERROR("End of memory");
                return ERROR_FAIL;
        }
@@ -560,7 +560,7 @@ static COMMAND_HELPER(create_nand_device, const char *bank_name,
                return retval;
        }
 
-       if (controller->usage == NULL)
+       if (!controller->usage)
                LOG_DEBUG("'%s' driver usage field missing", controller->name);
 
        nand_device_add(c);
@@ -580,7 +580,7 @@ COMMAND_HANDLER(handle_nand_device_command)
        const char *driver_name = CMD_ARGV[0];
        struct nand_flash_controller *controller;
        controller = nand_driver_find_by_name(CMD_ARGV[0]);
-       if (NULL == controller) {
+       if (!controller) {
                LOG_ERROR("No valid NAND flash driver found (%s)", driver_name);
                return CALL_COMMAND_HANDLER(handle_nand_list_drivers);
        }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)