openocd: fix Yoda conditions with checkpatch
[openocd.git] / src / target / nds32_v3_common.c
index 3abb3b9da2e791e0630dfb5abedcf9ec67c58e2c..b0c3de622fb80a6ba7b30ed9dcc317aca71aacd8 100644 (file)
@@ -93,7 +93,7 @@ static int nds32_v3_debug_entry(struct nds32 *nds32, bool enable_watchpoint)
                }
        }
 
-       if (ERROR_OK != nds32_examine_debug_reason(nds32)) {
+       if (nds32_examine_debug_reason(nds32) != ERROR_OK) {
                nds32->target->state = backup_state;
 
                /* re-activate all hardware breakpoints & watchpoints */
@@ -450,7 +450,7 @@ int nds32_v3_read_buffer(struct target *target, target_addr_t address,
        struct nds32 *nds32 = target_to_nds32(target);
        struct nds32_memory *memory = &(nds32->memory);
 
-       if ((NDS_MEMORY_ACC_CPU == memory->access_channel) &&
+       if ((memory->access_channel == NDS_MEMORY_ACC_CPU) &&
                        (target->state != TARGET_HALTED)) {
                LOG_WARNING("target was not halted");
                return ERROR_TARGET_NOT_HALTED;
@@ -474,7 +474,7 @@ int nds32_v3_read_buffer(struct target *target, target_addr_t address,
         * Because hardware will turn off IT/DT by default, it MUST translate virtual address
         * to physical address.
         */
-       if (ERROR_OK == target->type->virt2phys(target, address, &physical_address))
+       if (target->type->virt2phys(target, address, &physical_address) == ERROR_OK)
                address = physical_address;
        else
                return ERROR_FAIL;
@@ -508,7 +508,7 @@ int nds32_v3_write_buffer(struct target *target, target_addr_t address,
        struct nds32 *nds32 = target_to_nds32(target);
        struct nds32_memory *memory = &(nds32->memory);
 
-       if ((NDS_MEMORY_ACC_CPU == memory->access_channel) &&
+       if ((memory->access_channel == NDS_MEMORY_ACC_CPU) &&
                        (target->state != TARGET_HALTED)) {
                LOG_WARNING("target was not halted");
                return ERROR_TARGET_NOT_HALTED;
@@ -532,7 +532,7 @@ int nds32_v3_write_buffer(struct target *target, target_addr_t address,
         * Because hardware will turn off IT/DT by default, it MUST translate virtual address
         * to physical address.
         */
-       if (ERROR_OK == target->type->virt2phys(target, address, &physical_address))
+       if (target->type->virt2phys(target, address, &physical_address) == ERROR_OK)
                address = physical_address;
        else
                return ERROR_FAIL;
@@ -570,7 +570,7 @@ int nds32_v3_read_memory(struct target *target, target_addr_t address,
        struct nds32 *nds32 = target_to_nds32(target);
        struct nds32_memory *memory = &(nds32->memory);
 
-       if ((NDS_MEMORY_ACC_CPU == memory->access_channel) &&
+       if ((memory->access_channel == NDS_MEMORY_ACC_CPU) &&
                        (target->state != TARGET_HALTED)) {
                LOG_WARNING("target was not halted");
                return ERROR_TARGET_NOT_HALTED;
@@ -594,7 +594,7 @@ int nds32_v3_read_memory(struct target *target, target_addr_t address,
         * Because hardware will turn off IT/DT by default, it MUST translate virtual address
         * to physical address.
         */
-       if (ERROR_OK == target->type->virt2phys(target, address, &physical_address))
+       if (target->type->virt2phys(target, address, &physical_address) == ERROR_OK)
                address = physical_address;
        else
                return ERROR_FAIL;
@@ -628,7 +628,7 @@ int nds32_v3_write_memory(struct target *target, target_addr_t address,
        struct nds32 *nds32 = target_to_nds32(target);
        struct nds32_memory *memory = &(nds32->memory);
 
-       if ((NDS_MEMORY_ACC_CPU == memory->access_channel) &&
+       if ((memory->access_channel == NDS_MEMORY_ACC_CPU) &&
                        (target->state != TARGET_HALTED)) {
                LOG_WARNING("target was not halted");
                return ERROR_TARGET_NOT_HALTED;
@@ -652,7 +652,7 @@ int nds32_v3_write_memory(struct target *target, target_addr_t address,
         * Because hardware will turn off IT/DT by default, it MUST translate virtual address
         * to physical address.
         */
-       if (ERROR_OK == target->type->virt2phys(target, address, &physical_address))
+       if (target->type->virt2phys(target, address, &physical_address) == ERROR_OK)
                address = physical_address;
        else
                return ERROR_FAIL;

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)