* [PATCH 1/2] selftests/cpufreq: Remove unused local variables from switch_show_governor()
@ 2026-07-06 14:38 Jinseok Kim
2026-07-06 14:38 ` [PATCH 2/2] selftests/cpufreq: Remove unnecessary sudo from quick_shuffle() Jinseok Kim
2026-07-07 5:10 ` [PATCH 1/2] selftests/cpufreq: Remove unused local variables from switch_show_governor() Viresh Kumar
0 siblings, 2 replies; 4+ messages in thread
From: Jinseok Kim @ 2026-07-06 14:38 UTC (permalink / raw)
To: rafael, viresh.kumar, shuah; +Cc: linux-pm, linux-kselftest, linux-kernel
switch_show_governor() assigns the current governor and frequency
to local variables before switching governors.
However, these variables are never referenced afterwards. The function
does not restore the previous governor or use the saved frequency, as
backup_governor() and restore_governor() already handle state preservation
elsewhere.
Signed-off-by: Jinseok Kim <always.starving0@gmail.com>
---
tools/testing/selftests/cpufreq/governor.sh | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tools/testing/selftests/cpufreq/governor.sh b/tools/testing/selftests/cpufreq/governor.sh
index fe37df79c087..212ef1cf43d5 100755
--- a/tools/testing/selftests/cpufreq/governor.sh
+++ b/tools/testing/selftests/cpufreq/governor.sh
@@ -100,11 +100,6 @@ switch_governor()
# $1: policy, $2: governor
switch_show_governor()
{
- cur_gov=find_current_governor
- if [ $cur_gov == "userspace" ]; then
- cur_freq=find_current_freq
- fi
-
# switch governor
__switch_governor $1 $2
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] selftests/cpufreq: Remove unnecessary sudo from quick_shuffle()
2026-07-06 14:38 [PATCH 1/2] selftests/cpufreq: Remove unused local variables from switch_show_governor() Jinseok Kim
@ 2026-07-06 14:38 ` Jinseok Kim
2026-07-07 5:12 ` Viresh Kumar
2026-07-07 5:10 ` [PATCH 1/2] selftests/cpufreq: Remove unused local variables from switch_show_governor() Viresh Kumar
1 sibling, 1 reply; 4+ messages in thread
From: Jinseok Kim @ 2026-07-06 14:38 UTC (permalink / raw)
To: rafael, viresh.kumar, shuah; +Cc: linux-pm, linux-kselftest, linux-kernel
The cpufreq selftests are always executed through main.sh, which verifies
that the test is run as root before dispatching any test case.
Therefore, invoking sudo inside quick_shuffle() is redundant and may cause
failures in environments where sudo is unavailable.
Signed-off-by: Jinseok Kim <always.starving0@gmail.com>
---
tools/testing/selftests/cpufreq/special-tests.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/cpufreq/special-tests.sh b/tools/testing/selftests/cpufreq/special-tests.sh
index 8d40505dc468..f45eb525f3b1 100755
--- a/tools/testing/selftests/cpufreq/special-tests.sh
+++ b/tools/testing/selftests/cpufreq/special-tests.sh
@@ -65,8 +65,8 @@ quick_shuffle()
# this is called concurrently from governor_race
for I in `seq 1000`
do
- echo ondemand | sudo tee $CPUFREQROOT/policy*/scaling_governor &
- echo userspace | sudo tee $CPUFREQROOT/policy*/scaling_governor &
+ echo ondemand | tee $CPUFREQROOT/policy*/scaling_governor &
+ echo userspace | tee $CPUFREQROOT/policy*/scaling_governor &
done
}
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] selftests/cpufreq: Remove unused local variables from switch_show_governor()
2026-07-06 14:38 [PATCH 1/2] selftests/cpufreq: Remove unused local variables from switch_show_governor() Jinseok Kim
2026-07-06 14:38 ` [PATCH 2/2] selftests/cpufreq: Remove unnecessary sudo from quick_shuffle() Jinseok Kim
@ 2026-07-07 5:10 ` Viresh Kumar
1 sibling, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2026-07-07 5:10 UTC (permalink / raw)
To: Jinseok Kim; +Cc: rafael, shuah, linux-pm, linux-kselftest, linux-kernel
On 06-07-26, 23:38, Jinseok Kim wrote:
> switch_show_governor() assigns the current governor and frequency
> to local variables before switching governors.
>
> However, these variables are never referenced afterwards. The function
> does not restore the previous governor or use the saved frequency, as
> backup_governor() and restore_governor() already handle state preservation
> elsewhere.
>
> Signed-off-by: Jinseok Kim <always.starving0@gmail.com>
> ---
> tools/testing/selftests/cpufreq/governor.sh | 5 -----
> 1 file changed, 5 deletions(-)
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] selftests/cpufreq: Remove unnecessary sudo from quick_shuffle()
2026-07-06 14:38 ` [PATCH 2/2] selftests/cpufreq: Remove unnecessary sudo from quick_shuffle() Jinseok Kim
@ 2026-07-07 5:12 ` Viresh Kumar
0 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2026-07-07 5:12 UTC (permalink / raw)
To: Jinseok Kim; +Cc: rafael, shuah, linux-pm, linux-kselftest, linux-kernel
On 06-07-26, 23:38, Jinseok Kim wrote:
> The cpufreq selftests are always executed through main.sh, which verifies
> that the test is run as root before dispatching any test case.
>
> Therefore, invoking sudo inside quick_shuffle() is redundant and may cause
> failures in environments where sudo is unavailable.
>
> Signed-off-by: Jinseok Kim <always.starving0@gmail.com>
> ---
> tools/testing/selftests/cpufreq/special-tests.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-07 5:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 14:38 [PATCH 1/2] selftests/cpufreq: Remove unused local variables from switch_show_governor() Jinseok Kim
2026-07-06 14:38 ` [PATCH 2/2] selftests/cpufreq: Remove unnecessary sudo from quick_shuffle() Jinseok Kim
2026-07-07 5:12 ` Viresh Kumar
2026-07-07 5:10 ` [PATCH 1/2] selftests/cpufreq: Remove unused local variables from switch_show_governor() Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox