diff mbox series

Solve Kselftest patch task

Message ID YvTlBGB6OSvwQ+AN@autolfshost (mailing list archive)
State New
Headers show
Series Solve Kselftest patch task | expand

Commit Message

Anup K Parikh Aug. 11, 2022, 11:16 a.m. UTC
Most messages were perfect and so this is a minor pretty print change

Signed-off-by: Anup K Parikh <parikhanupk.foss@gmail.com>
---
 tools/testing/selftests/cpufreq/cpu.sh | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/cpufreq/cpu.sh b/tools/testing/selftests/cpufreq/cpu.sh
index 39fdcdfb8..fac318e8f 100755
--- a/tools/testing/selftests/cpufreq/cpu.sh
+++ b/tools/testing/selftests/cpufreq/cpu.sh
@@ -49,11 +49,22 @@  reboot_cpu()
 	online_cpu $1
 }
 
+#$1: number
+prettyprint_number_times()
+{
+	if [ "x$1" = "x1" ]; then
+		echo "once"
+	else
+		echo "$1 times"
+	fi
+}
+
 # Reboot CPUs
 # param: number of times we want to run the loop
 reboot_cpus()
 {
-	printf "** Test: Running ${FUNCNAME[0]} for $1 loops **\n\n"
+	local ptimes=`prettyprint_number_times $1`
+	printf "** Test: Running ${FUNCNAME[0]} $ptimes **\n\n"
 
 	for i in `seq 1 $1`; do
 		for_each_non_boot_cpu offline_cpu