openocd: fix simple cases of NULL comparison
[openocd.git] / src / target / lakemont.c
index 31b521b3a8418f97c5442ce2a03031d24f1e64fd..e3f331d13ad950ee03c46214312ff4a4e3e5a914 100644 (file)
@@ -227,7 +227,7 @@ static int irscan(struct target *t, uint8_t *out,
 {
        int retval = ERROR_OK;
        struct x86_32_common *x86_32 = target_to_x86_32(t);
-       if (NULL == t->tap) {
+       if (!t->tap) {
                retval = ERROR_FAIL;
                LOG_ERROR("%s invalid target tap", __func__);
                return retval;
@@ -260,7 +260,7 @@ static int drscan(struct target *t, uint8_t *out, uint8_t *in, uint8_t len)
        int retval = ERROR_OK;
        uint64_t data = 0;
        struct x86_32_common *x86_32 = target_to_x86_32(t);
-       if (NULL == t->tap) {
+       if (!t->tap) {
                retval = ERROR_FAIL;
                LOG_ERROR("%s invalid target tap", __func__);
                return retval;
@@ -283,7 +283,7 @@ static int drscan(struct target *t, uint8_t *out, uint8_t *in, uint8_t len)
                        return retval;
                }
        }
-       if (in != NULL) {
+       if (in) {
                if (len >= 8) {
                        for (int n = (len / 8) - 1 ; n >= 0; n--)
                                data = (data << 8) + *(in+n);
@@ -940,7 +940,7 @@ int lakemont_poll(struct target *t)
                                 */
                                struct breakpoint *bp = NULL;
                                bp = breakpoint_find(t, eip-1);
-                               if (bp != NULL) {
+                               if (bp) {
                                        t->debug_reason = DBG_REASON_BREAKPOINT;
                                        if (bp->type == BKPT_SOFT) {
                                                /* The EIP is now pointing the next byte after the
@@ -1128,7 +1128,7 @@ static int lakemont_reset_break(struct target *t)
 
        /* prepare resetbreak setting the proper bits in CLTAPC_CPU_VPREQ */
        x86_32->curr_tap = jtag_tap_by_position(1);
-       if (x86_32->curr_tap == NULL) {
+       if (!x86_32->curr_tap) {
                x86_32->curr_tap = saved_tap;
                LOG_ERROR("%s could not select quark_x10xx.cltap", __func__);
                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)