public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: “Samir <samir@linux.ibm.com>
To: ltp@lists.linux.it
Cc: “Samir <samir@linux.ibm.com>
Subject: [LTP] [PATCH] hugeshmget: Use __func__ instead of hardcoded function
Date: Tue,  7 Apr 2026 11:19:37 +0530	[thread overview]
Message-ID: <20260407054943.125260-1-samir@linux.ibm.com> (raw)

Replace hardcoded "setup" string with __func__ in error messages
to follow LTP coding style guidelines(make check).

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__);

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__);
 }
 
 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

                 reply	other threads:[~2026-04-06 12:26 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=20260407054943.125260-1-samir@linux.ibm.com \
    --to=samir@linux.ibm.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