Skip to contentSkip to conversation

selftests/intel_pstate: fix operand expected

PATCH Superseded Alessandro Zanni 2 participants 2 messages Oct 14, 2024 Kselftest

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/intel_pstate: fix operand expected

This fix solves these errors, when calling kselftest with targets "intel_pstate":

- ./run.sh: line 90: / 1000: syntax error: operand expected (error token is "/ 1000")
- ./run.sh: line 92: / 1000: syntax error: operand expected (error token is "/ 1000")

To error was found by running tests manually with the command:
make kselftest TARGETS=intel_pstate

---
 tools/testing/selftests/intel_pstate/run.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tools/testing/selftests/intel_pstate/run.sh +4 -2
index e7008f614ad7..39130a359535 100755
@@ -87,9 +87,11 @@ mkt_freq=${_mkt_freq}0
 
 # Get the ranges from cpupower
 _min_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $1 } ')
-min_freq=$(($_min_freq / 1000))
+min_freq=$((_min_freq / 1000))
+echo "min_freq:"
+echo $min_freq
 _max_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $2 } ')
-max_freq=$(($_max_freq / 1000))
+max_freq=$((_max_freq / 1000))
 
 
 [ $EVALUATE_ONLY -eq 0 ] && for freq in `seq $max_freq -100 $min_freq`
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 2 lines · Alessandro Zanni

This fix solves these errors, when calling kselftest with targets "intel_pstate":

What is "calling" kselftest? Please include the command you ran in the change log.

Also, say "Fix" instead of "This fix"

Running "command" results in the following errors:

<errors>

Fix them

Quoted 7 lines

- ./run.sh: line 90: / 1000: syntax error: operand expected (error token is "/ 1000")
- ./run.sh: line 92: / 1000: syntax error: operand expected (error token is "/ 1000")

To error was found by running tests manually with the command:

"To" -> These?

Quoted 1 line

make kselftest TARGETS=intel_pstate

Why not just move this up:

I don't see any errors when I run the above command on Linux 6.12-rc3 What's you environment like?

Quoted 14 lines
---
  tools/testing/selftests/intel_pstate/run.sh | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
tools/testing/selftests/intel_pstate/run.sh +0 -0
index e7008f614ad7..39130a359535 100755
@@ -87,9 +87,11 @@ mkt_freq=${_mkt_freq}0
 
  # Get the ranges from cpupower
  _min_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $1 } ')

tools/testing/selftests/intel_pstate/run.sh mkt_freq=${_mkt_freq}0 · line 97

Quoted 10 lines
tools/testing/selftests/intel_pstate/run.sh +4 -2
-min_freq=$(($_min_freq / 1000))
+min_freq=$((_min_freq / 1000))
+echo "min_freq:"
+echo $min_freq
  _max_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $2 } ')
-max_freq=$(($_max_freq / 1000))
+max_freq=$((_max_freq / 1000))
 
 
  [ $EVALUATE_ONLY -eq 0 ] && for freq in `seq $max_freq -100 $min_freq`

thanks,
-- Shuah