jtag: move prototype of adapter init/quit and speed to adapter.h
[openocd.git] / src / jtag / tcl.c
index 2355babf0602a9c71d53d9d13ba48aa341ab9934..8bf4ea9c10d1140f1f0ad883a63ccc8723048009 100644 (file)
@@ -30,6 +30,7 @@
 #include "config.h"
 #endif
 
+#include "adapter.h"
 #include "jtag.h"
 #include "swd.h"
 #include "minidriver.h"
@@ -62,9 +63,9 @@ struct jtag_tap *jtag_tap_by_jim_obj(Jim_Interp *interp, Jim_Obj *o)
 {
        const char *cp = Jim_GetString(o, NULL);
        struct jtag_tap *t = cp ? jtag_tap_by_string(cp) : NULL;
-       if (NULL == cp)
+       if (!cp)
                cp = "(unknown)";
-       if (NULL == t)
+       if (!t)
                Jim_SetResultFormatted(interp, "Tap '%s' could not be found", cp);
        return t;
 }
@@ -162,7 +163,7 @@ static int jim_command_drscan(Jim_Interp *interp, int argc, Jim_Obj * const *arg
        assert(e == JIM_OK);
 
        tap = jtag_tap_by_jim_obj(interp, args[1]);
-       if (tap == NULL)
+       if (!tap)
                return JIM_ERR;
 
        num_fields = (argc-2)/2;
@@ -362,7 +363,7 @@ static int jtag_tap_configure_event(struct jim_getopt_info *goi, struct jtag_tap
        if (goi->isconfigure) {
                if (!found)
                        jteap = calloc(1, sizeof(*jteap));
-               else if (NULL != jteap->body)
+               else if (jteap->body)
                        Jim_DecrRefCount(goi->interp, jteap->body);
 
                jteap->interp = goi->interp;
@@ -640,7 +641,7 @@ static void jtag_tap_handle_event(struct jtag_tap *tap, enum jtag_event e)
        struct jtag_tap_event_action *jteap;
        int retval;
 
-       for (jteap = tap->event_action; jteap != NULL; jteap = jteap->next) {
+       for (jteap = tap->event_action; jteap; jteap = jteap->next) {
                if (jteap->event != e)
                        continue;
 
@@ -769,7 +770,7 @@ int jim_jtag_tap_enabler(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        struct jtag_tap *t;
 
        t = jtag_tap_by_jim_obj(goi.interp, goi.argv[0]);
-       if (t == NULL)
+       if (!t)
                return JIM_ERR;
 
        if (strcasecmp(cmd_name, "tapisenabled") == 0) {
@@ -811,7 +812,7 @@ int jim_jtag_configure(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        Jim_Obj *o;
        jim_getopt_obj(&goi, &o);
        t = jtag_tap_by_jim_obj(goi.interp, o);
-       if (t == NULL)
+       if (!t)
                return JIM_ERR;
 
        return jtag_tap_configure_cmd(&goi, t);
@@ -1122,7 +1123,7 @@ COMMAND_HANDLER(handle_irscan_command)
        int retval;
        for (i = 0; i < num_fields; i++) {
                tap = jtag_tap_by_string(CMD_ARGV[i*2]);
-               if (tap == NULL) {
+               if (!tap) {
                        free(fields);
                        command_print(CMD, "Tap: %s unknown", CMD_ARGV[i*2]);
 

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)