jtag/core: Use 'bool' data type for 'bypass' 40/8040/2
authorMarc Schink <dev@zapb.de>
Wed, 6 Dec 2023 17:11:11 +0000 (18:11 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 16 Dec 2023 07:52:34 +0000 (07:52 +0000)
Change-Id: I918fd5ce674e808ad6a96634a11046d2b3f6a05c
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8040
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
src/jtag/core.c
src/jtag/drivers/driver.c
src/jtag/jtag.h

index 665a932190f9ebc1456c54fa7220df2cbde0a7c9..e2af6c53d94f0a63c7f74200463dc8d4f90ea322 100644 (file)
@@ -1049,7 +1049,7 @@ static int jtag_reset_callback(enum jtag_event event, void *priv)
 
                /* current instruction is either BYPASS or IDCODE */
                buf_set_ones(tap->cur_instr, tap->ir_length);
-               tap->bypass = 1;
+               tap->bypass = true;
        }
 
        return ERROR_OK;
@@ -1464,7 +1464,7 @@ void jtag_tap_init(struct jtag_tap *tap)
        buf_set_u32(tap->expected_mask, 0, ir_len_bits, tap->ir_capture_mask);
 
        /* TAP will be in bypass mode after jtag_validate_ircapture() */
-       tap->bypass = 1;
+       tap->bypass = true;
        buf_set_ones(tap->cur_instr, tap->ir_length);
 
        /* register the reset callback for the TAP */
index 409b80087458801799713ce3b7df4de240a52ed4..7732315003062f73fbf1a7ef0facccedce9f9b42 100644 (file)
@@ -76,13 +76,13 @@ int interface_jtag_add_ir_scan(struct jtag_tap *active,
 
                if (tap == active) {
                        /* if TAP is listed in input fields, copy the value */
-                       tap->bypass = 0;
+                       tap->bypass = false;
 
                        jtag_scan_field_clone(field, in_fields);
                } else {
                        /* if a TAP isn't listed in input fields, set it to BYPASS */
 
-                       tap->bypass = 1;
+                       tap->bypass = true;
 
                        field->num_bits = tap->ir_length;
                        field->out_value = buf_set_ones(cmd_queue_alloc(DIV_ROUND_UP(tap->ir_length, 8)), tap->ir_length);
index 7353104f0a3fa88412ebdd46c411fe53d237f85b..1d1c495cf1d78ad93e12f3ef93763b293eb1f767 100644 (file)
@@ -131,7 +131,7 @@ struct jtag_tap {
        /** current instruction */
        uint8_t *cur_instr;
        /** Bypass register selected */
-       int bypass;
+       bool bypass;
 
        struct jtag_tap_event_action *event_action;
 

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)