From ac63cd00d792331914db0b6edd3f427c30eec3fa Mon Sep 17 00:00:00 2001 From: Tomas Vanek Date: Fri, 2 Aug 2024 19:45:09 +0200 Subject: [PATCH] tcl/interface/raspberrypi5-gpiod: fix string match pattern escaping Use correct TCL syntax and save string map operation. Change-Id: Ic2a522bd57cf6610b7df1d9cddd0fbdc2076ed62 Signed-off-by: Tomas Vanek Reviewed-on: https://review.openocd.org/c/openocd/+/8426 Tested-by: jenkins Reviewed-by: Antonio Borneo --- tcl/interface/raspberrypi5-gpiod.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcl/interface/raspberrypi5-gpiod.cfg b/tcl/interface/raspberrypi5-gpiod.cfg index f3fdde0f2..9624ad511 100644 --- a/tcl/interface/raspberrypi5-gpiod.cfg +++ b/tcl/interface/raspberrypi5-gpiod.cfg @@ -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 "**" [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'" }