- Fixes '==' whitespace
[openocd.git] / src / jtag / core.c
index 5bf7295ec78c33e60dec22407d286125db34a555..34ad11b075d1171253979585169dd630b6e4649d 100644 (file)
@@ -142,7 +142,7 @@ unsigned jtag_tap_count_enabled(void)
 {
        jtag_tap_t *t = jtag_all_taps();
        unsigned n = 0;
-       while(t)
+       while (t)
        {
                if (t->enabled)
                        n++;
@@ -157,7 +157,7 @@ void jtag_tap_add(struct jtag_tap_s *t)
        t->abs_chain_position = jtag_num_taps++;
 
        jtag_tap_t **tap = &__jtag_all_taps;
-       while(*tap != NULL)
+       while (*tap != NULL)
                tap = &(*tap)->next_tap;
        *tap = t;
 }
@@ -302,7 +302,7 @@ static void jtag_prelude(tap_state_t state)
 {
        jtag_checks();
 
-       assert(state!=TAP_INVALID);
+       assert(state != TAP_INVALID);
 
        cmd_queue_cur_state = state;
 }
@@ -324,7 +324,7 @@ void jtag_add_ir_scan_noverify(int in_count, const scan_field_t *in_fields,
 
 void jtag_add_ir_scan(int in_num_fields, scan_field_t *in_fields, tap_state_t state)
 {
-       if (jtag_verify&&jtag_verify_capture_ir)
+       if (jtag_verify && jtag_verify_capture_ir)
        {
                /* 8 x 32 bit id's is enough for all invocations */
 
@@ -508,13 +508,13 @@ int jtag_add_statemove(tap_state_t goal_state)
                tap_state_name(goal_state) );
 
 
-       if (goal_state==cur_state )
+       if (goal_state == cur_state )
                ;       /* nothing to do */
-       else if( goal_state==TAP_RESET )
+       else if ( goal_state == TAP_RESET )
        {
                jtag_add_tlr();
        }
-       else if( tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state) )
+       else if ( tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state) )
        {
                unsigned tms_bits  = tap_get_tms_path(cur_state, goal_state);
                unsigned tms_count = tap_get_tms_path_len(cur_state, goal_state);
@@ -531,7 +531,7 @@ int jtag_add_statemove(tap_state_t goal_state)
 
                jtag_add_pathmove(tms_count, moves);
        }
-       else if( tap_state_transition(cur_state, true)  == goal_state
+       else if ( tap_state_transition(cur_state, true)  == goal_state
                ||   tap_state_transition(cur_state, false) == goal_state )
        {
                jtag_add_pathmove(1, &goal_state);
@@ -576,12 +576,12 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst)
         */
        if ((jtag_reset_config & RESET_HAS_SRST)&&
                        (jtag_reset_config & RESET_HAS_TRST)&&
-                       ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0))
+                       ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0))
        {
                if (((req_tlr_or_trst&&!jtag_trst)||
-                               (!req_tlr_or_trst&&jtag_trst))&&
+                               (!req_tlr_or_trst && jtag_trst))&&
                                ((req_srst&&!jtag_srst)||
-                                               (!req_srst&&jtag_srst)))
+                                               (!req_srst && jtag_srst)))
                {
                        /* FIX!!! srst_pulls_trst allows 1,1 => 0,0 transition.... */
                        //LOG_ERROR("BUG: transition of req_tlr_or_trst and req_srst in the same jtag_add_reset() call is undefined");
@@ -676,7 +676,7 @@ tap_state_t jtag_set_end_state(tap_state_t state)
                LOG_ERROR("BUG: TAP_DRSHIFT/IRSHIFT can't be end state. Calling code should use a larger scan field");
        }
 
-       if (state!=TAP_INVALID)
+       if (state != TAP_INVALID)
                cmd_queue_end_state = state;
        return cmd_queue_end_state;
 }
@@ -746,7 +746,7 @@ void jtag_check_value_mask(scan_field_t *field, uint8_t *value, uint8_t *mask)
 {
        assert(field->in_value != NULL);
 
-       if (value==NULL)
+       if (value == NULL)
        {
                /* no checking to do */
                return;
@@ -1024,9 +1024,9 @@ int jtag_validate_chain(void)
 
        tap = NULL;
        total_ir_length = 0;
-       for(;;){
+       for (;;){
                tap = jtag_tap_next_enabled(tap);
-               if( tap == NULL ){
+               if ( tap == NULL ){
                        break;
                }
                total_ir_length += tap->ir_length;
@@ -1048,9 +1048,9 @@ int jtag_validate_chain(void)
        tap = NULL;
        chain_pos = 0;
        int val;
-       for(;;){
+       for (;;){
                tap = jtag_tap_next_enabled(tap);
-               if( tap == NULL ){
+               if ( tap == NULL ){
                        break;
                }
 
@@ -1130,7 +1130,7 @@ int jtag_interface_init(struct command_context_s *cmd_ctx)
                LOG_ERROR("JTAG interface has to be specified, see \"interface\" command");
                return ERROR_JTAG_INVALID_INTERFACE;
        }
-       if(hasKHz)
+       if (hasKHz)
        {
                jtag_interface->khz(jtag_get_speed_khz(), &jtag_speed);
                hasKHz = false;
@@ -1151,13 +1151,13 @@ static int jtag_init_inner(struct command_context_s *cmd_ctx)
        LOG_DEBUG("Init JTAG chain");
 
        tap = jtag_tap_next_enabled(NULL);
-       if( tap == NULL ){
+       if ( tap == NULL ){
                LOG_ERROR("There are no enabled taps?");
                return ERROR_JTAG_INIT_FAILED;
        }
 
        jtag_add_tlr();
-       if ((retval=jtag_execute_queue())!=ERROR_OK)
+       if ((retval=jtag_execute_queue()) != ERROR_OK)
                return retval;
 
        /* examine chain first, as this could discover the real chain layout */
@@ -1216,7 +1216,7 @@ int jtag_init_reset(struct command_context_s *cmd_ctx)
        if (jtag_reset_config & RESET_HAS_SRST)
        {
                jtag_add_reset(1, 1);
-               if ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0)
+               if ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0)
                        jtag_add_reset(0, 1);
        }
        jtag_add_reset(0, 0);
@@ -1238,7 +1238,7 @@ int jtag_init(struct command_context_s *cmd_ctx)
        int retval;
        if ((retval=jtag_interface_init(cmd_ctx)) != ERROR_OK)
                return retval;
-       if (jtag_init_inner(cmd_ctx)==ERROR_OK)
+       if (jtag_init_inner(cmd_ctx) == ERROR_OK)
        {
                return ERROR_OK;
        }

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)