* + selftests-centralise-maybe-unused-definition-in-kselftesth.patch added to mm-nonmm-unstable branch
@ 2025-08-21 22:05 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-08-21 22:05 UTC (permalink / raw)
To: mm-commits, sj, shuah, richard.weiyang, akpm,
reddybalavignesh9979, akpm
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-21 22:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 22:05 + selftests-centralise-maybe-unused-definition-in-kselftesth.patch added to mm-nonmm-unstable branch Andrew Morton
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.