From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,sj@kernel.org,shuah@kernel.org,richard.weiyang@gmail.com,akpm@linux-foundation.org,reddybalavignesh9979@gmail.com,akpm@linux-foundation.org
Subject: + selftests-centralise-maybe-unused-definition-in-kselftesth.patch added to mm-nonmm-unstable branch
Date: Thu, 21 Aug 2025 15:05:58 -0700 [thread overview]
Message-ID: <20250821220559.43305C4CEEB@smtp.kernel.org> (raw)
The patch titled
Subject: selftests: centralise maybe-unused definition in kselftest.h
has been added to the -mm mm-nonmm-unstable branch. Its filename is
selftests-centralise-maybe-unused-definition-in-kselftesth.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-centralise-maybe-unused-definition-in-kselftesth.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
Subject: selftests: centralise maybe-unused definition in kselftest.h
Date: Thu, 21 Aug 2025 15:41:59 +0530
Several selftests subdirectories duplicated the define __maybe_unused,
leading to redundant code. Move to kselftest.h header and remove other
definitions.
This addresses the duplication noted in the proc-pid-vm warning fix
Link: https://lkml.kernel.org/r/20250821101159.2238-1-reddybalavignesh9979@gmail.com
Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Link:https://lore.kernel.org/lkml/20250820143954.33d95635e504e94df01930d0@linux-foundation.org/
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/kselftest.h | 4 ++++
tools/testing/selftests/landlock/audit.h | 6 ++----
tools/testing/selftests/landlock/common.h | 4 ----
tools/testing/selftests/mm/pkey-helpers.h | 3 ---
tools/testing/selftests/net/psock_lib.h | 4 ----
tools/testing/selftests/perf_events/watermark_signal.c | 2 --
tools/testing/selftests/proc/proc-pid-vm.c | 4 ----
tools/testing/selftests/ublk/utils.h | 2 --
8 files changed, 6 insertions(+), 23 deletions(-)
--- a/tools/testing/selftests/kselftest.h~selftests-centralise-maybe-unused-definition-in-kselftesth
+++ a/tools/testing/selftests/kselftest.h
@@ -96,6 +96,10 @@
#define __unused __attribute__((__unused__))
#endif
+#ifndef __maybe_unused
+#define __maybe_unused __attribute__((__unused__))
+#endif
+
/* counters */
struct ksft_count {
unsigned int ksft_pass;
--- a/tools/testing/selftests/landlock/audit.h~selftests-centralise-maybe-unused-definition-in-kselftesth
+++ a/tools/testing/selftests/landlock/audit.h
@@ -20,14 +20,12 @@
#include <sys/time.h>
#include <unistd.h>
+#include "../kselftest.h"
+
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#endif
-#ifndef __maybe_unused
-#define __maybe_unused __attribute__((__unused__))
-#endif
-
#define REGEX_LANDLOCK_PREFIX "^audit([0-9.:]\\+): domain=\\([0-9a-f]\\+\\)"
struct audit_filter {
--- a/tools/testing/selftests/landlock/common.h~selftests-centralise-maybe-unused-definition-in-kselftesth
+++ a/tools/testing/selftests/landlock/common.h
@@ -22,10 +22,6 @@
#define TMP_DIR "tmp"
-#ifndef __maybe_unused
-#define __maybe_unused __attribute__((__unused__))
-#endif
-
/* TEST_F_FORK() should not be used for new tests. */
#define TEST_F_FORK(fixture_name, test_name) TEST_F(fixture_name, test_name)
--- a/tools/testing/selftests/mm/pkey-helpers.h~selftests-centralise-maybe-unused-definition-in-kselftesth
+++ a/tools/testing/selftests/mm/pkey-helpers.h
@@ -84,9 +84,6 @@ extern void abort_hooks(void);
#ifndef noinline
# define noinline __attribute__((noinline))
#endif
-#ifndef __maybe_unused
-# define __maybe_unused __attribute__((__unused__))
-#endif
int sys_pkey_alloc(unsigned long flags, unsigned long init_val);
int sys_pkey_free(unsigned long pkey);
--- a/tools/testing/selftests/net/psock_lib.h~selftests-centralise-maybe-unused-definition-in-kselftesth
+++ a/tools/testing/selftests/net/psock_lib.h
@@ -22,10 +22,6 @@
#define PORT_BASE 8000
-#ifndef __maybe_unused
-# define __maybe_unused __attribute__ ((__unused__))
-#endif
-
static __maybe_unused void pair_udp_setfilter(int fd)
{
/* the filter below checks for all of the following conditions that
--- a/tools/testing/selftests/perf_events/watermark_signal.c~selftests-centralise-maybe-unused-definition-in-kselftesth
+++ a/tools/testing/selftests/perf_events/watermark_signal.c
@@ -17,8 +17,6 @@
#include "../kselftest_harness.h"
-#define __maybe_unused __attribute__((__unused__))
-
static int sigio_count;
static void handle_sigio(int signum __maybe_unused,
--- a/tools/testing/selftests/proc/proc-pid-vm.c~selftests-centralise-maybe-unused-definition-in-kselftesth
+++ a/tools/testing/selftests/proc/proc-pid-vm.c
@@ -47,10 +47,6 @@
#include <sys/resource.h>
#include <linux/fs.h>
-#ifndef __maybe_unused
-#define __maybe_unused __attribute__((__unused__))
-#endif
-
#include "../kselftest.h"
static inline long sys_execveat(int dirfd, const char *pathname, char **argv, char **envp, int flags)
--- a/tools/testing/selftests/ublk/utils.h~selftests-centralise-maybe-unused-definition-in-kselftesth
+++ a/tools/testing/selftests/ublk/utils.h
@@ -2,8 +2,6 @@
#ifndef KUBLK_UTILS_H
#define KUBLK_UTILS_H
-#define __maybe_unused __attribute__((unused))
-
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
_
Patches currently in -mm which might be from reddybalavignesh9979@gmail.com are
selftests-proc-mark-vsyscall-strings-maybe-unused.patch
selftests-centralise-maybe-unused-definition-in-kselftesth.patch
reply other threads:[~2025-08-21 22:05 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=20250821220559.43305C4CEEB@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=mm-commits@vger.kernel.org \
--cc=reddybalavignesh9979@gmail.com \
--cc=richard.weiyang@gmail.com \
--cc=shuah@kernel.org \
--cc=sj@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.