Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: huangjuniter@foxmail.com
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] pm_include.sh: Fix no_of_sockets calculation error of is_multi_socket() function.
Date: Mon, 29 Aug 2022 21:49:12 +0200	[thread overview]
Message-ID: <Yw0YOJ07DcV8dSA2@pevik> (raw)
In-Reply-To: <tencent_8D749A790ABC81A17D9575610A12AD6D3D05@qq.com>

Hi Jun,

nit: Commit message could be better: shorter subject (first line)
and more descriptive description after single blank line.
That would help me avoiding asking question bellow.

> From: Jun Huang <huangjuniter@foxmail.com>

nit: there should have been your Signed-off-by:

Signed-off-by: Jun Huang <huangjuniter@foxmail.com>

> ---
>  testcases/kernel/power_management/pm_include.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

> diff --git a/testcases/kernel/power_management/pm_include.sh b/testcases/kernel/power_management/pm_include.sh
> index 35ff0f1e6..f3e160445 100755
> --- a/testcases/kernel/power_management/pm_include.sh
> +++ b/testcases/kernel/power_management/pm_include.sh
> @@ -124,8 +124,8 @@ check_input() {

>  is_multi_socket() {
>  	no_of_sockets=`cat \
> -		/sys/devices/system/cpu/cpu?/topology/physical_package_id \
> -		| uniq | wc -l`
> +		/sys/devices/system/cpu/cpu*/topology/physical_package_id \
> +		| sort -u | wc -l`
>  	[ $no_of_sockets -gt 1 ] ; echo $?
>  }

I was going to merge it, but is it really needed? Unsorted input to unique will
can lead to higher number of count, but because anything higher than 1 results
in echo 0 and 0 will result in 1 due this code:

[ $no_of_sockets -gt 1 ] ; echo $?

i.e. 2 or more different files will result in count higher than 1 regardless
using sorted uniq (sort -u) or just uniq. Or am I missing something?

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-08-29 19:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-27  1:55 [LTP] [PATCH] pm_include.sh: Fix no_of_sockets calculation error of is_multi_socket() function huangjuniter
2022-08-29 19:49 ` Petr Vorel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-08-31  2:54 dreamhj

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=Yw0YOJ07DcV8dSA2@pevik \
    --to=pvorel@suse.cz \
    --cc=huangjuniter@foxmail.com \
    --cc=ltp@lists.linux.it \
    /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