public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: “Samir <samir@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] hugeshmget: Use __func__ instead of hardcoded function
Date: Wed, 8 Apr 2026 11:34:46 +0200	[thread overview]
Message-ID: <adYhNrtHEGBRO2xF@yuki.lan> (raw)
In-Reply-To: <20260407054943.125260-1-samir@linux.ibm.com>

Hi!
> Fixed in:
> - hugeshmget02.c:83
> - hugeshmget03.c:76
> - hugeshmget05.c:75
> 
> Changed from: tst_brk(TBROK | TERRNO, "shmget #setup");
> Changed to:   tst_brk(TBROK | TERRNO, "shmget #%s", __func__);

You should really use SAFE_SHMGET() in the setup() in the 02 and 05
tests instead.

> Signed-off-by: “Samir <samir@linux.ibm.com>
> ---
>  testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c | 2 +-
>  testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c | 2 +-
>  testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c
> index bbd968c06..065aa05fc 100644
> --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c
> +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c
> @@ -80,7 +80,7 @@ void setup(void)
>  	shm_id_1 = shmget(shmkey, shm_size,
>  			  SHM_HUGETLB | IPC_CREAT | IPC_EXCL | SHM_RW);
>  	if (shm_id_1 == -1)
> -		tst_brk(TBROK | TERRNO, "shmget #setup");
> +		tst_brk(TBROK | TERRNO, "shmget #%s", __func__);
>  }
>  
>  void cleanup(void)
> diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c
> index 625761f6e..1f07d585a 100644
> --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c
> +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c
> @@ -73,7 +73,7 @@ static void setup(void)
>  				  SHM_HUGETLB | IPC_CREAT | IPC_EXCL | SHM_RW);
>  	}
>  	if (errno != ENOSPC)
> -		tst_brk(TBROK | TERRNO, "shmget #setup");
> +		tst_brk(TBROK | TERRNO, "shmget #%s", __func__);

And here you should probably just print tst_brk(TBROK | TERRNO, "shmget()");

There is enough information printed by the tst_brk() to locate the
failure, no need to add more.

>  
>  static void cleanup(void)
> diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c
> index 336319603..a2bb9020d 100644
> --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c
> +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c
> @@ -72,7 +72,7 @@ void setup(void)
>  	shm_id_1 = shmget(shmkey, shm_size,
>  			  SHM_HUGETLB | SHM_RW | IPC_CREAT | IPC_EXCL);
>  	if (shm_id_1 == -1)
> -		tst_brk(TBROK | TERRNO, "shmget #setup");
> +		tst_brk(TBROK | TERRNO, "shmget #%s", __func__);
>  
>  	/* get the userid for a non-root user */
>  	ltp_uid = getuserid(ltp_user);
> -- 
> 2.52.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

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

      reply	other threads:[~2026-04-08  9:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07  5:49 [LTP] [PATCH] hugeshmget: Use __func__ instead of hardcoded function “Samir
2026-04-08  9:34 ` Cyril Hrubis [this message]

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=adYhNrtHEGBRO2xF@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=samir@linux.ibm.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