JTAG: "jtag newtap ..." cleanup
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 27 Oct 2009 06:06:22 +0000 (23:06 -0700)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 27 Oct 2009 06:06:22 +0000 (23:06 -0700)
Get rid of needless variable, improve and shrink diagnostic.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/jtag/tcl.c

index 6a6e3ae018e8c253c761a1ef762f63c78264795b..5056a5c5d58ac10acdd9438f65a72628979d94ae 100644 (file)
@@ -197,7 +197,6 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
        jim_wide w;
        int x;
        int e;
-       int reqbits;
        Jim_Nvp *n;
        char *cp;
        const Jim_Nvp opts[] = {
@@ -252,9 +251,6 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
        pTap->ir_capture_mask = 0x03;
        pTap->ir_capture_value = 0x01;
 
-       /* clear flags for "required options" them as we find them */
-       reqbits = 1;
-
        while (goi->argc) {
                e = Jim_GetOpt_Nvp(goi, opts, &n);
                if (e != JIM_OK) {
@@ -317,7 +313,6 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
                                                        pTap->dotted_name,
                                                        (int) w);
                                pTap->ir_length = w;
-                               reqbits = 0;
                                break;
                        case NTAP_OPT_IRMASK:
                                if (is_bad_irval(pTap->ir_length, w)) {
@@ -355,14 +350,14 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
        pTap->enabled = !pTap->disabled_after_reset;
 
        /* Did all the required option bits get cleared? */
-       if (0 == reqbits)
+       if (pTap->ir_length != 0)
        {
                jtag_tap_init(pTap);
                return ERROR_OK;
        }
 
        Jim_SetResult_sprintf(goi->interp,
-                       "newtap: %s missing required parameters",
+                       "newtap: %s missing IR length",
                        pTap->dotted_name);
        jtag_tap_free(pTap);
        return JIM_ERR;

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)