public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Leo Yu-Chi Liang <ycliang@andestech.com>
Cc: cynthia@andestech.com, patrick@andestech.com, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] hugeshmat04: Restore the correct shmmax value
Date: Thu, 3 Aug 2023 12:42:26 +0200	[thread overview]
Message-ID: <ZMuEkuWpcIkEN3QP@yuki> (raw)
In-Reply-To: <20230803103004.2429973-1-ycliang@andestech.com>

Hi!
> Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
> ---
>  testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c
> index 50efa8a52..b3e7c272a 100644
> --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c
> +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat04.c
> @@ -83,12 +83,12 @@ static void setup(void)
>  	long hpage_size, orig_hugepages;
>  
>  	orig_hugepages = get_sys_tune("nr_hugepages");
> -	SAFE_FILE_SCANF(PATH_SHMMAX, "%ld", &orig_shmmax);
> -	SAFE_FILE_PRINTF(PATH_SHMMAX, "%ld", (long)SIZE);
> -	SAFE_FILE_SCANF(PATH_SHMMAX, "%ld", &new_shmmax);
> +	SAFE_FILE_SCANF(PATH_SHMMAX, "%lu", &orig_shmmax);
> +	SAFE_FILE_PRINTF(PATH_SHMMAX, "%lu", (long)SIZE);
> +	SAFE_FILE_SCANF(PATH_SHMMAX, "%lu", &new_shmmax);
>  
>  	if (new_shmmax < SIZE)
> -		tst_brk(TCONF,	"shmmax too low, have: %ld", new_shmmax);
> +		tst_brk(TCONF,	"shmmax too low, have: %lu", new_shmmax);
>  
>  	hpage_size = SAFE_READ_MEMINFO("Hugepagesize:") * 1024;
>  
> @@ -99,7 +99,7 @@ static void setup(void)
>  static void cleanup(void)
>  {
>  	if (orig_shmmax != -1)
> -		SAFE_FILE_PRINTF(PATH_SHMMAX, "%ld", orig_shmmax);
> +		SAFE_FILE_PRINTF(PATH_SHMMAX, "%lu", orig_shmmax);
>  }

Can we please move the PATH_SHMMAX restoration to the .save_restore part
of the tst_test structure?

https://github.com/linux-test-project/ltp/wiki/C-Test-API#127-saving--restoring-procsys-values

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2023-08-03 10:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 10:30 [LTP] [PATCH 1/1] hugeshmat04: Restore the correct shmmax value Leo Yu-Chi Liang
2023-08-03 10:42 ` Cyril Hrubis [this message]
2023-08-05  2:41   ` Leo Liang

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=ZMuEkuWpcIkEN3QP@yuki \
    --to=chrubis@suse.cz \
    --cc=cynthia@andestech.com \
    --cc=ltp@lists.linux.it \
    --cc=patrick@andestech.com \
    --cc=ycliang@andestech.com \
    /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