Skip to content

Commit

Permalink
tcl/interface/raspberrypi5-gpiod: fix string match pattern escaping
Browse files Browse the repository at this point in the history
Use correct TCL syntax and save string map operation.

Change-Id: Ic2a522bd57cf6610b7df1d9cddd0fbdc2076ed62
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8426
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
  • Loading branch information
tom-van committed Aug 16, 2024
1 parent efe9022 commit ac63cd0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tcl/interface/raspberrypi5-gpiod.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ proc read_file { name } {
}

set pcie_aspm [read_file /sys/module/pcie_aspm/parameters/policy]
# escaping [ ] characters in string match pattern does not work in Jim-Tcl
if {![string match "*<performance>*" [string map { "\[" < "\]" > } $pcie_aspm]]} {
if {![string match {*\[performance\]*} $pcie_aspm]} {
echo "Warn : Switch PCIe power saving off or the first couple of pulses gets clocked as fast as 20 MHz"
echo "Warn : Issue 'echo performance | sudo tee /sys/module/pcie_aspm/parameters/policy'"
}
Expand Down

0 comments on commit ac63cd0

Please sign in to comment.