mirror-linux/tools/testing/selftests
Edward Liaw cc937dad85 selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk
Centralize the _GNU_SOURCE definition to CFLAGS in lib.mk.  Remove
redundant defines from Makefiles that import lib.mk.  Convert any usage of
"#define _GNU_SOURCE 1" to "#define _GNU_SOURCE".

This uses the form "-D_GNU_SOURCE=", which is equivalent to
"#define _GNU_SOURCE".

Otherwise using "-D_GNU_SOURCE" is equivalent to "-D_GNU_SOURCE=1" and
"#define _GNU_SOURCE 1", which is less commonly seen in source code and
would require many changes in selftests to avoid redefinition warnings.

Link: https://lkml.kernel.org/r/20240625223454.1586259-2-edliaw@google.com
Signed-off-by: Edward Liaw <edliaw@google.com>
Suggested-by: John Hubbard <jhubbard@nvidia.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: André Almeida <andrealmeid@igalia.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Kees Cook <kees@kernel.org>
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-07-10 12:14:51 -07:00
..
alsa kselftest/alsa: Ensure _GNU_SOURCE is defined 2024-05-29 12:23:57 -06:00
amd-pstate
arm64 kselftest: arm64: Add a null pointer check 2024-04-28 08:42:58 +01:00
bpf selftests/bpf: Add tests for may_goto with negative offset. 2024-06-24 13:44:02 +02:00
breakpoints
cachestat selftests: cachestat: Fix build warnings on ppc64 2024-05-29 12:24:44 -06:00
capabilities selftests/capabilities: fix warn_unused_result build warnings 2024-05-08 16:48:25 -06:00
cgroup linux_kselftest-next-6.10-rc1-fixes 2024-05-20 14:49:39 -07:00
clone3 selftests/clone3: ksft_exit functions do not return 2024-05-06 13:57:20 -06:00
connector
core selftests: add F_DUPDFD_QUERY selftests 2024-05-10 08:49:13 +02:00
cpu-hotplug
cpufreq selftests: cpufreq: conform test to TAP 2024-05-06 13:57:20 -06:00
damon selftests/damon/damon_nr_regions: test online-tuned max_nr_regions 2024-07-03 19:30:29 -07:00
devices
dma
dmabuf-heaps selftests/dmabuf-heap: conform test to TAP format output 2024-05-06 13:57:19 -06:00
drivers selftests: virtio_net: add forgotten config options 2024-06-20 07:10:32 -07:00
dt linux_kselftest-next-6.9-rc1 2024-03-11 09:25:33 -07:00
efivarfs
exec selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
fchmodat2 selftests/fchmodat2: fix clang build failure due to -static-libasan 2024-06-11 15:05:05 -06:00
filelock
filesystems selftests: filesystems: fix warn_unused_result build warnings 2024-06-11 09:21:30 -06:00
firmware
fpu
ftrace selftests/tracing: Fix event filter test to retry up to 10 times 2024-05-31 08:35:43 -06:00
futex selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
gpio selftest: gpio: remove obsolete gpio-mockup test 2024-03-05 20:01:08 +01:00
hid selftests/hid: skip tests with HID-BPF if udev-hid-bpf is not installed 2024-05-07 15:39:58 +02:00
ia64
intel_pstate selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
iommu selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
ipc selftests/ipc: ksft_exit functions do not return 2024-05-06 13:57:20 -06:00
ir
kcmp selftests/kcmp: remove unused open mode 2024-05-11 15:51:43 -07:00
kexec
kmod
kselftest selftests: ktap_helpers: Make it POSIX-compliant 2024-05-06 13:57:20 -06:00
kvm selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
landlock selftests/landlock: Add layout1.refer_mount_root 2024-05-31 16:41:54 +02:00
lib
livepatch linux_kselftest-next-6.9-rc1 2024-03-11 09:25:33 -07:00
lkdtm
locking
lsm lsm: use 32-bit compatible data types in LSM syscalls 2024-03-14 11:31:26 -04:00
media_tests
membarrier selftests: membarrier: ksft_exit_pass() does not return 2024-05-06 13:57:20 -06:00
memfd selftests/memfd: fix spelling mistakes 2024-05-07 10:36:59 -07:00
memory-hotplug
mincore
mm selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
mount
mount_setattr
move_mount_set_group
mqueue selftests/mqueue: Set timeout to 180 seconds 2024-02-20 17:28:19 -07:00
nci
net selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
nolibc tools/nolibc: add support for uname(2) 2024-04-14 20:28:54 +02:00
nsfs
ntb
openat2 selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS 2024-06-11 15:00:11 -06:00
perf_events selftests/perf_events: Test FASYNC with watermark wakeups 2024-04-14 22:26:33 +02:00
pid_namespace
pidfd linux_kselftest-next-6.10-rc1 2024-05-14 11:36:54 -07:00
power_supply selftests: power_supply: Make it POSIX-compliant 2024-05-06 13:57:20 -06:00
powerpc powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
prctl
proc selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
pstore
ptp
ptrace
rcutorture torture: Scale --do-kvfree test time 2024-04-16 11:16:36 +02:00
resctrl selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
ring-buffer selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
riscv selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
rlimits
rseq
rtc
rust kselftest: Add basic test for probing the rust sample modules 2024-03-04 13:13:04 -07:00
safesetid
sched selftests: sched: Fix spelling mistake "hiearchy" -> "hierarchy" 2024-02-20 17:28:19 -07:00
seccomp selftests: seccomp: fix format-zero-length warnings 2024-06-11 09:25:43 -06:00
sgx selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
sigaltstack
size
sparc64
splice
static_keys
sync selftests: sync: ksft_exit_pass() does not return 2024-05-06 13:57:21 -06:00
syscall_user_dispatch selftests: sud_test: return correct emulated syscall value on RISC-V 2024-04-25 09:46:41 -07:00
sysctl
tc-testing net/sched: taprio: extend minimum interval restriction to entire cycle too 2024-05-28 19:46:41 -07:00
tdx
thermal/intel selftests: thermal: intel: workload_hint: add missing gitignore 2024-02-20 16:30:55 -07:00
timens
timers selftests: timers: ksft_exit functions do not return 2024-05-06 13:57:21 -06:00
tmpfs selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
tpm2
tty kselftest/tty: Report a consistent test name for the one test we run 2024-05-06 13:57:19 -06:00
turbostat tools/power turbostat: v2024.04.10 2024-04-10 09:07:57 -04:00
uevent selftests: uevent: add missing gitignore 2024-02-20 16:30:40 -07:00
user
user_events selftests/user_events: Add non-spacing separator check 2024-05-13 12:15:46 -04:00
vDSO selftests/vDSO: fix runtime errors on LoongArch 2024-05-05 17:28:07 -07:00
watchdog
wireguard printk changes for 6.10 2024-05-15 12:34:46 -07:00
x86 The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
zram
.gitignore
Makefile Revert "selftests: Compile kselftest headers with -D_GNU_SOURCE" 2024-05-20 08:59:58 -06:00
gen_kselftest_tar.sh
kselftest.h selftests: kselftest: Make ksft_exit functions return void instead of int 2024-05-06 13:57:21 -06:00
kselftest_deps.sh selftests: kselftest_deps: fix l5_test() empty variable 2024-05-08 16:46:41 -06:00
kselftest_harness.h - A series ("kbuild: enable more warnings by default") from Arnd 2024-05-22 18:59:29 -07:00
kselftest_install.sh
kselftest_module.h
lib.mk selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk 2024-07-10 12:14:51 -07:00
run_kselftest.sh