Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Anup K Parikh <parikhanupk.foss@gmail.com>
To: skhan@linuxfoundation.org
Cc: linux-kselftest@vger.kernel.org
Subject: [PATCH] Solve Kselftest patch task
Date: Thu, 11 Aug 2022 16:46:20 +0530	[thread overview]
Message-ID: <YvTlBGB6OSvwQ+AN@autolfshost> (raw)

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 --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
-- 
2.35.1


                 reply	other threads:[~2022-08-11 11:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YvTlBGB6OSvwQ+AN@autolfshost \
    --to=parikhanupk.foss@gmail.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox