- Replace '){' with ') {'.
[openocd.git] / src / jtag / tcl.c
index aad6781118cba2fbd32a2fc2113771a8f8705ce1..2ea3868dc015261edc3f57c3c22a80a334037785 100644 (file)
@@ -340,7 +340,7 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
        /*
         * we expect CHIP + TAP + OPTIONS
         * */
-       if (goi->argc < 3){
+       if (goi->argc < 3) {
                Jim_SetResult_sprintf(goi->interp, "Missing CHIP TAP OPTIONS ....");
                return JIM_ERR;
        }
@@ -367,14 +367,14 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
        /* clear them as we find them */
        reqbits = (NTREQ_IRLEN | NTREQ_IRCAPTURE | NTREQ_IRMASK);
 
-       while (goi->argc){
+       while (goi->argc) {
                e = Jim_GetOpt_Nvp(goi, opts, &n);
-               if (e != JIM_OK){
+               if (e != JIM_OK) {
                        Jim_GetOpt_NvpUnknown(goi, opts, 0);
                        return e;
                }
                LOG_DEBUG("Processing option: %s", n->name);
-               switch (n->value){
+               switch (n->value) {
                case NTAP_OPT_ENABLED:
                        pTap->disabled_after_reset = false;
                        break;
@@ -410,11 +410,11 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi)
                case NTAP_OPT_IRMASK:
                case NTAP_OPT_IRCAPTURE:
                        e = Jim_GetOpt_Wide(goi, &w);
-                       if (e != JIM_OK){
+                       if (e != JIM_OK) {
                                Jim_SetResult_sprintf(goi->interp, "option: %s bad parameter", n->name);
                                return e;
                        }
-                       switch (n->value){
+                       switch (n->value) {
                        case NTAP_OPT_IRLEN:
                                if (w > (jim_wide) (8 * sizeof(pTap->ir_capture_value)))
                                        LOG_WARNING("huge IR length %d", (int) w);
@@ -535,29 +535,29 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
 
        e = Jim_GetOpt_Nvp(&goi, jtag_cmds, &n);
-       if (e != JIM_OK){
+       if (e != JIM_OK) {
                Jim_GetOpt_NvpUnknown(&goi, jtag_cmds, 0);
                return e;
        }
                Jim_SetEmptyResult(goi.interp);
-       switch (n->value){
+       switch (n->value) {
        case JTAG_CMD_INTERFACE:
                /* return the name of the interface */
                /* TCL code might need to know the exact type... */
                /* FUTURE: we allow this as a means to "set" the interface. */
-               if (goi.argc != 0){
+               if (goi.argc != 0) {
                        Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
                        return JIM_ERR;
                }
                Jim_SetResultString(goi.interp, jtag_interface->name, -1);
                return JIM_OK;
        case JTAG_CMD_INIT_RESET:
-               if (goi.argc != 0){
+               if (goi.argc != 0) {
                        Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
                        return JIM_ERR;
                }
                e = jtag_init_reset(context);
-               if (e != ERROR_OK){
+               if (e != ERROR_OK) {
                        Jim_SetResult_sprintf(goi.interp, "error: %d", e);
                        return JIM_ERR;
                }
@@ -568,7 +568,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        case JTAG_CMD_TAPISENABLED:
        case JTAG_CMD_TAPENABLE:
        case JTAG_CMD_TAPDISABLE:
-               if (goi.argc != 1){
+               if (goi.argc != 1) {
                        Jim_SetResultString(goi.interp, "Too many parameters",-1);
                        return JIM_ERR;
                }
@@ -619,7 +619,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
                break;
 
        case JTAG_CMD_CGET:
-               if (goi.argc < 2){
+               if (goi.argc < 2) {
                        Jim_WrongNumArgs(goi.interp, 0, NULL, "?tap-name? -option ...");
                        return JIM_ERR;
                }
@@ -629,7 +629,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
                        Jim_GetOpt_Obj(&goi, &o);
                        t = jtag_tap_by_jim_obj(goi.interp, o);
-                       if (t == NULL){
+                       if (t == NULL) {
                                return JIM_ERR;
                        }
 
@@ -639,7 +639,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
                break;
 
        case JTAG_CMD_CONFIGURE:
-               if (goi.argc < 3){
+               if (goi.argc < 3) {
                        Jim_WrongNumArgs(goi.interp, 0, NULL, "?tap-name? -option ?VALUE? ...");
                        return JIM_ERR;
                }
@@ -649,7 +649,7 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
                        Jim_GetOpt_Obj(&goi, &o);
                        t = jtag_tap_by_jim_obj(goi.interp, o);
-                       if (t == NULL){
+                       if (t == NULL) {
                                return JIM_ERR;
                        }
 
@@ -806,7 +806,7 @@ static int handle_jtag_device_command(struct command_context_s *cmd_ctx, char *c
         * argv[ 3] = not actually used by anything but in the docs
         */
 
-       if (argc < 4){
+       if (argc < 4) {
                command_print(cmd_ctx, "OLD DEPRECATED SYNTAX: Please use the NEW syntax");
                return ERROR_OK;
        }
@@ -847,7 +847,7 @@ static int handle_jtag_device_command(struct command_context_s *cmd_ctx, char *c
                         Jim_GetString(newargs[9], NULL));
 
        e = jim_jtag_command(interp, 10, newargs);
-       if (e != JIM_OK){
+       if (e != JIM_OK) {
                command_print(cmd_ctx, "%s", Jim_GetString(Jim_GetResult(interp), NULL));
        }
        return e;
@@ -861,7 +861,7 @@ static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cm
        command_print(cmd_ctx, "     TapName            | Enabled |   IdCode      Expected    IrLen IrCap  IrMask Instr     ");
        command_print(cmd_ctx, "---|--------------------|---------|------------|------------|------|------|------|---------");
 
-       while (tap){
+       while (tap) {
                uint32_t expected, expected_mask, cur_instr, ii;
                expected = buf_get_u32(tap->expected, 0, tap->ir_length);
                expected_mask = buf_get_u32(tap->expected_mask, 0, tap->ir_length);
@@ -1174,20 +1174,20 @@ static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, c
         */
        endstate = TAP_IDLE;
 
-       if (argc >= 4){
+       if (argc >= 4) {
                /* have at least one pair of numbers. */
                /* is last pair the magic text? */
-               if (0 == strcmp("-endstate", args[ argc - 2 ])){
+               if (0 == strcmp("-endstate", args[ argc - 2 ])) {
                        const char *cpA;
                        const char *cpS;
                        cpA = args[ argc-1 ];
-                       for (endstate = 0 ; endstate < TAP_NUM_STATES ; endstate++){
+                       for (endstate = 0 ; endstate < TAP_NUM_STATES ; endstate++) {
                                cpS = tap_state_name(endstate);
-                               if (0 == strcmp(cpA, cpS)){
+                               if (0 == strcmp(cpA, cpS)) {
                                        break;
                                }
                        }
-                       if (endstate >= TAP_NUM_STATES){
+                       if (endstate >= TAP_NUM_STATES) {
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        } else {
                                if (!scan_is_safe(endstate))
@@ -1281,12 +1281,12 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args
 
                e = Jim_GetLong(interp, args[i], &bits);
                /* If valid - try next arg */
-               if (e == JIM_OK){
+               if (e == JIM_OK) {
                        continue;
                }
 
                /* Not valid.. are we at the end? */
-               if (((i + 2) != argc)){
+               if (((i + 2) != argc)) {
                        /* nope, then error */
                        return e;
                }
@@ -1299,13 +1299,13 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args
                /* get arg as a string. */
                cp = Jim_GetString(args[i], NULL);
                /* is it the magic? */
-               if (0 == strcmp("-endstate", cp)){
+               if (0 == strcmp("-endstate", cp)) {
                        /* is the statename valid? */
                        cp = Jim_GetString(args[i + 1], NULL);
 
                        /* see if it is a valid state name */
                        endstate = tap_state_by_name(cp);
-                       if (endstate < 0){
+                       if (endstate < 0) {
                                /* update the error message */
                                Jim_SetResult_sprintf(interp,"endstate: %s invalid", cp);
                        } else {
@@ -1321,13 +1321,13 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args
                }
 
                /* Still an error? */
-               if (e != JIM_OK){
+               if (e != JIM_OK) {
                        return e; /* too bad */
                }
        } /* validate args */
 
        tap = jtag_tap_by_jim_obj(interp, args[1]);
-       if (tap == NULL){
+       if (tap == NULL) {
                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)