tcl: don't use 'set' to retrieve the value of a variable 63/6863/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Tue, 1 Mar 2022 22:21:20 +0000 (23:21 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 12 Mar 2022 09:43:00 +0000 (09:43 +0000)
Original TLC syntax uses 'set varname' to retrieve the value of
variable 'varname'. Such archaic syntax is still valid, but the
shorter '$varname' makes the code easier to read.

Replace 'set varname' with '$varname'.
While there, remove some useless curly brackets.

Change-Id: I27310e8c05afe56ea8bd0e41d4ae2c34447b725c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6863
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
tcl/board/lemaker_hikey.cfg
tcl/board/tocoding_poplar.cfg
tcl/target/bluefield.cfg
tcl/target/xilinx_zynqmp.cfg

index ee677c34b8bb8e4a3a7c40b681b1d03c4aff3a9a..325b6fdda0f08808995c48df3d3365819dbbcdc7 100644 (file)
@@ -17,7 +17,7 @@ proc core_up { args } {
        global _TARGETNAME
 
        # examine remaining cores
-       foreach _core [set args] {
+       foreach _core $args {
                ${_TARGETNAME}$_core arp_examine
        }
 }
index 6d2e6354e52aab6eba6b0619c30bf6626dcd0afb..36d5aec47da0bc4e36987393f700a4024688079c 100644 (file)
@@ -19,7 +19,7 @@ proc core_up { args } {
        global _TARGETNAME
 
        # examine remaining cores
-       foreach _core [set args] {
+       foreach _core $args {
                ${_TARGETNAME}$_core arp_examine
        }
 }
index 62b1e31650d105c97573a4e496f9ef520c579c98..dcebb2fb11a504b5f046d55387ea3a07ea04d200 100644 (file)
@@ -72,7 +72,7 @@ proc core_up { args } {
        global _TARGETNAME
 
        # Examine remaining cores
-       foreach _core [set args] {
+       foreach _core $args {
                ${_TARGETNAME}$_core arp_examine
        }
 }
index e66289a707b96e7d3bef414c76381232f10e1195..2df7a4ff9176f4cbcc1d4ec0551da617b20ff0b3 100644 (file)
@@ -99,7 +99,7 @@ targets $_TARGETNAME.0
 
 proc core_up { args } {
     global _TARGETNAME
-    foreach { core } [set args] {
+    foreach core $args {
         $_TARGETNAME.$core arp_examine
     }
 }

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)