Define _GNU_SOURCE for sources using
Subsystems (47)
v3 cover Define _GNU_SOURCE for sources using
Centralizes the definition of _GNU_SOURCE into KHDR_INCLUDES and removes redefinitions of _GNU_SOURCE from source code.
809216233555 ("selftests/harness: remove use of LINE_MAX") introduced asprintf into kselftest_harness.h, which is a GNU extension and needs _GNU_SOURCE to either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.
v1: https://lore.kernel.org/linux-kselftest/[email protected]/
v2: https://lore.kernel.org/linux-kselftest/[email protected]/
- Add -D_GNU_SOURCE to KHDR_INCLUDES so that it is in a single
location.
- Remove #define _GNU_SOURCE from source code to resolve redefinition warnings.
v3:
- Rebase onto linux-next.
- Split patches by directory.
- Add -D_GNU_SOURCE directly to CFLAGS in lib.mk.
- Delete additional _GNU_SOURCE definitions from source code in linux-next.
- Delete additional -D_GNU_SOURCE flags from Makefiles.
Edward Liaw (68):
selftests: Compile kselftest headers with -D_GNU_SOURCE selftests/sgx: Include KHDR_INCLUDES in Makefile
selftests: Compile with -D_GNU_SOURCE when including lib.mk selftests/arm64: Drop define _GNU_SOURCE selftests/arm64: Drop duplicate -D_GNU_SOURCE selftests/bpf: Drop define _GNU_SOURCE selftests/breakpoints: Drop define _GNU_SOURCE selftests/cachestat: Drop define _GNU_SOURCE selftests/capabilities: Drop define _GNU_SOURCE selftests/cgroup: Drop define _GNU_SOURCE selftests/clone3: Drop define _GNU_SOURCE selftests/core: Drop define _GNU_SOURCE selftests/damon: Drop define _GNU_SOURCE selftests/drivers: Drop define _GNU_SOURCE selftests/exec: Drop duplicate -D_GNU_SOURCE selftests/fchmodat2: Drop define _GNU_SOURCE selftests/filelock: Drop define _GNU_SOURCE selftests/filesystems: Drop define _GNU_SOURCE selftests/firmware: Drop define _GNU_SOURCE selftests/fpu: Drop define _GNU_SOURCE selftests/futex: Drop define _GNU_SOURCE selftests/futex: Drop duplicate -D_GNU_SOURCE selftests/intel_pstate: Drop duplicate -D_GNU_SOURCE selftests/iommu: Drop duplicate -D_GNU_SOURCE selftests/ipc: Drop define _GNU_SOURCE selftests/kcmp: Drop define _GNU_SOURCE selftests/landlock: Drop define _GNU_SOURCE selftests/lsm: Drop define _GNU_SOURCE selftests/membarrier: Drop define _GNU_SOURCE selftests/memfd: Drop define _GNU_SOURCE selftests/mincore: Drop define _GNU_SOURCE selftests/mm: Drop define _GNU_SOURCE selftests/mount: Drop define _GNU_SOURCE selftests/mount_setattr: Drop define _GNU_SOURCE selftests/move_mount_set_group: Drop define _GNU_SOURCE selftests/mqueue: Drop define _GNU_SOURCE selftests/net: Drop define _GNU_SOURCE selftests/net: Drop duplicate -D_GNU_SOURCE selftests/nolibc: Drop define _GNU_SOURCE selftests/nsfs: Drop define _GNU_SOURCE selftests/openat2: Drop define _GNU_SOURCE selftests/perf_events: Drop define _GNU_SOURCE selftests/pid_namespace: Drop define _GNU_SOURCE selftests/pidfd: Drop define _GNU_SOURCE selftests/ptrace: Drop define _GNU_SOURCE selftests/powerpc: Drop define _GNU_SOURCE selftests/proc: Drop define _GNU_SOURCE selftests/proc: Drop duplicate -D_GNU_SOURCE selftests/ptp: Drop define _GNU_SOURCE selftests/resctrl: Drop duplicate -D_GNU_SOURCE selftests/riscv: Drop define _GNU_SOURCE selftests/riscv: Drop duplicate -D_GNU_SOURCE selftests/rlimits: Drop define _GNU_SOURCE selftests/rseq: Drop define _GNU_SOURCE selftests/safesetid: Drop define _GNU_SOURCE selftests/sched: Drop define _GNU_SOURCE selftests/seccomp: Drop define _GNU_SOURCE selftests/sigaltstack: Drop define _GNU_SOURCE selftests/splice: Drop define _GNU_SOURCE selftests/syscall_user_dispatch: Drop define _GNU_SOURCE selftests/thermal: Drop define _GNU_SOURCE selftests/timens: Drop define _GNU_SOURCE selftests/tmpfs: Drop duplicate -D_GNU_SOURCE selftests/uevent: Drop define _GNU_SOURCE selftests/user_events: Drop define _GNU_SOURCE selftests/vDSO: Drop define _GNU_SOURCE selftests/wireguard: Drop define _GNU_SOURCE selftests/x86: Drop define _GNU_SOURCE
tools/testing/selftests/arm64/fp/fp-ptrace.c | 3 --- tools/testing/selftests/arm64/fp/fp-stress.c | 2 -- tools/testing/selftests/arm64/fp/vlset.c | 1 - tools/testing/selftests/arm64/mte/check_buffer_fill.c | 3 --- tools/testing/selftests/arm64/mte/check_child_memory.c | 3 --- tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c | 3 --- tools/testing/selftests/arm64/mte/check_ksm_options.c | 3 --- tools/testing/selftests/arm64/mte/check_mmap_options.c | 3 --- tools/testing/selftests/arm64/mte/check_tags_inclusion.c | 3 --- tools/testing/selftests/arm64/mte/check_user_mem.c | 3 --- tools/testing/selftests/arm64/pauth/pac.c | 3 --- tools/testing/selftests/arm64/signal/Makefile | 2 +- tools/testing/selftests/bpf/bench.c | 1 - tools/testing/selftests/bpf/benchs/bench_trigger.c | 1 - tools/testing/selftests/bpf/cgroup_helpers.c | 1 - tools/testing/selftests/bpf/map_tests/task_storage_map.c | 1 - tools/testing/selftests/bpf/network_helpers.c | 2 -- tools/testing/selftests/bpf/prog_tests/bind_perm.c | 1 - tools/testing/selftests/bpf/prog_tests/bpf_cookie.c | 1 - tools/testing/selftests/bpf/prog_tests/bpf_iter_setsockopt.c | 1 - tools/testing/selftests/bpf/prog_tests/bpf_obj_pinning.c | 1 - tools/testing/selftests/bpf/prog_tests/btf_endian.c | 1 - tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c | 2 -- tools/testing/selftests/bpf/prog_tests/cgrp_kfunc.c | 2 -- tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c | 2 -- tools/testing/selftests/bpf/prog_tests/cls_redirect.c | 3 --- tools/testing/selftests/bpf/prog_tests/connect_ping.c | 2 -- tools/testing/selftests/bpf/prog_tests/core_retro.c | 1 - tools/testing/selftests/bpf/prog_tests/d_path.c | 1 - tools/testing/selftests/bpf/prog_tests/deny_namespace.c | 1 - tools/testing/selftests/bpf/prog_tests/fexit_sleep.c | 1 - .../selftests/bpf/prog_tests/flow_dissector_reattach.c | 2 -- tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c | 1 - tools/testing/selftests/bpf/prog_tests/htab_reuse.c | 1 - tools/testing/selftests/bpf/prog_tests/htab_update.c | 1 - tools/testing/selftests/bpf/prog_tests/map_in_map.c | 1 - tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c | 2 -- tools/testing/selftests/bpf/prog_tests/perf_branches.c | 1 - tools/testing/selftests/bpf/prog_tests/perf_buffer.c | 1 - tools/testing/selftests/bpf/prog_tests/perf_event_stackmap.c | 1 - tools/testing/selftests/bpf/prog_tests/perf_link.c | 1 - tools/testing/selftests/bpf/prog_tests/perf_skip.c | 2 -- tools/testing/selftests/bpf/prog_tests/preempted_bpf_ma_op.c | 1 - tools/testing/selftests/bpf/prog_tests/rcu_read_lock.c | 2 -- tools/testing/selftests/bpf/prog_tests/reg_bounds.c | 2 -- tools/testing/selftests/bpf/prog_tests/ringbuf.c | 1 - tools/testing/selftests/bpf/prog_tests/ringbuf_multi.c | 1 - tools/testing/selftests/bpf/prog_tests/setget_sockopt.c | 2 -- tools/testing/selftests/bpf/prog_tests/sk_assign.c | 2 -- tools/testing/selftests/bpf/prog_tests/sk_lookup.c | 2 -- tools/testing/selftests/bpf/prog_tests/sock_fields.c | 2 -- tools/testing/selftests/bpf/prog_tests/task_kfunc.c | 2 -- tools/testing/selftests/bpf/prog_tests/task_local_storage.c | 2 -- tools/testing/selftests/bpf/prog_tests/task_pt_regs.c | 1 - tools/testing/selftests/bpf/prog_tests/tcp_custom_syncookie.c | 2 -- tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c | 2 -- tools/testing/selftests/bpf/prog_tests/test_bpf_ma.c | 1 - .../testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c | 1 - tools/testing/selftests/bpf/prog_tests/test_bpffs.c | 1 - tools/testing/selftests/bpf/prog_tests/test_overhead.c | 1 - tools/testing/selftests/bpf/prog_tests/token.c | 1 - tools/testing/selftests/bpf/prog_tests/trace_ext.c | 2 -- tools/testing/selftests/bpf/prog_tests/trampoline_count.c | 1 - tools/testing/selftests/bpf/prog_tests/user_ringbuf.c | 2 -- tools/testing/selftests/bpf/prog_tests/xdp_bonding.c | 2 -- tools/testing/selftests/bpf/prog_tests/xdp_synproxy.c | 2 -- tools/testing/selftests/bpf/test_flow_dissector.c | 3 --- tools/testing/selftests/bpf/test_lru_map.c | 1 - tools/testing/selftests/bpf/test_progs.c | 1 - tools/testing/selftests/bpf/test_sock_addr.c | 3 --- tools/testing/selftests/bpf/test_tcpnotify_user.c | 1 - tools/testing/selftests/bpf/veristat.c | 1 - tools/testing/selftests/bpf/xskxceiver.c | 2 -- tools/testing/selftests/breakpoints/breakpoint_test_arm64.c | 3 --- tools/testing/selftests/breakpoints/step_after_suspend_test.c | 3 --- tools/testing/selftests/cachestat/test_cachestat.c | 2 -- tools/testing/selftests/capabilities/test_execve.c | 2 -- tools/testing/selftests/cgroup/cgroup_util.c | 3 --- tools/testing/selftests/cgroup/test_core.c | 2 -- tools/testing/selftests/cgroup/test_cpu.c | 2 -- tools/testing/selftests/cgroup/test_hugetlb_memcg.c | 2 -- tools/testing/selftests/cgroup/test_kmem.c | 2 -- tools/testing/selftests/cgroup/test_memcontrol.c | 2 -- tools/testing/selftests/cgroup/test_zswap.c | 2 -- tools/testing/selftests/clone3/clone3.c | 2 -- .../testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 2 -- tools/testing/selftests/clone3/clone3_clear_sighand.c | 2 -- tools/testing/selftests/clone3/clone3_selftests.h | 1 - tools/testing/selftests/clone3/clone3_set_tid.c | 2 -- tools/testing/selftests/core/close_range_test.c | 2 -- tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c | 3 --- .../damon/debugfs_target_ids_read_before_terminate_race.c | 2 -- tools/testing/selftests/drivers/dma-buf/udmabuf.c | 1 - tools/testing/selftests/exec/Makefile | 1 - tools/testing/selftests/fchmodat2/fchmodat2_test.c | 2 -- tools/testing/selftests/filelock/ofdlocks.c | 2 -- tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 2 -- tools/testing/selftests/filesystems/devpts_pts.c | 1 - tools/testing/selftests/filesystems/dnotify_test.c | 1 - tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c | 2 -- tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 2 -- tools/testing/selftests/filesystems/fat/rename_exchange.c | 2 -- tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c | 2 -- .../testing/selftests/filesystems/statmount/statmount_test.c | 3 --- tools/testing/selftests/firmware/fw_namespace.c | 1 - tools/testing/selftests/fpu/test_fpu.c | 2 -- tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/futex/functional/futex_requeue_pi.c | 3 --- tools/testing/selftests/intel_pstate/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 2 -- tools/testing/selftests/ipc/msgque.c | 1 - tools/testing/selftests/kcmp/kcmp_test.c | 2 -- tools/testing/selftests/kselftest_harness.h | 2 +- tools/testing/selftests/landlock/base_test.c | 2 -- tools/testing/selftests/landlock/fs_test.c | 2 -- tools/testing/selftests/landlock/net_test.c | 2 -- tools/testing/selftests/landlock/ptrace_test.c | 2 -- tools/testing/selftests/lib.mk | 3 +++ tools/testing/selftests/lsm/common.c | 2 -- tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 2 -- tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 -- tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 2 -- tools/testing/selftests/membarrier/membarrier_test_impl.h | 1 - .../selftests/membarrier/membarrier_test_multi_thread.c | 1 - .../selftests/membarrier/membarrier_test_single_thread.c | 1 - tools/testing/selftests/memfd/common.c | 1 - tools/testing/selftests/memfd/fuse_test.c | 2 -- tools/testing/selftests/memfd/memfd_test.c | 1 - tools/testing/selftests/mincore/mincore_selftest.c | 3 --- tools/testing/selftests/mm/cow.c | 1 - tools/testing/selftests/mm/gup_longterm.c | 1 - tools/testing/selftests/mm/hugepage-mmap.c | 1 - tools/testing/selftests/mm/hugepage-mremap.c | 2 -- tools/testing/selftests/mm/hugetlb-madvise.c | 2 -- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 2 -- tools/testing/selftests/mm/khugepaged.c | 1 - tools/testing/selftests/mm/ksm_functional_tests.c | 1 - tools/testing/selftests/mm/madv_populate.c | 1 - tools/testing/selftests/mm/map_populate.c | 2 -- tools/testing/selftests/mm/mdwe_test.c | 1 - tools/testing/selftests/mm/memfd_secret.c | 2 -- tools/testing/selftests/mm/mlock2-tests.c | 1 - tools/testing/selftests/mm/mrelease_test.c | 1 - tools/testing/selftests/mm/mremap_dontunmap.c | 1 - tools/testing/selftests/mm/mremap_test.c | 2 -- tools/testing/selftests/mm/mseal_test.c | 1 - tools/testing/selftests/mm/pagemap_ioctl.c | 1 - tools/testing/selftests/mm/pkey-helpers.h | 1 - tools/testing/selftests/mm/protection_keys.c | 1 - tools/testing/selftests/mm/seal_elf.c | 1 - tools/testing/selftests/mm/split_huge_page_test.c | 2 -- tools/testing/selftests/mm/thuge-gen.c | 2 -- tools/testing/selftests/mm/uffd-common.h | 1 - tools/testing/selftests/mount/nosymfollow-test.c | 1 - tools/testing/selftests/mount/unprivileged-remount-test.c | 1 - tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 - .../move_mount_set_group/move_mount_set_group_test.c | 1 - tools/testing/selftests/mqueue/mq_perf_tests.c | 1 - tools/testing/selftests/net/af_unix/diag_uid.c | 2 -- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/scm_rights.c | 1 - tools/testing/selftests/net/af_unix/unix_connect.c | 2 -- tools/testing/selftests/net/csum.c | 3 --- tools/testing/selftests/net/gro.c | 3 --- tools/testing/selftests/net/ip_defrag.c | 3 --- tools/testing/selftests/net/ipsec.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel_mgr.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_inq.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 3 --- tools/testing/selftests/net/msg_zerocopy.c | 3 --- tools/testing/selftests/net/netfilter/audit_logread.c | 2 -- tools/testing/selftests/net/netfilter/conntrack_dump_flush.c | 3 --- tools/testing/selftests/net/nettest.c | 2 -- tools/testing/selftests/net/psock_fanout.c | 3 --- tools/testing/selftests/net/psock_snd.c | 3 --- tools/testing/selftests/net/reuseport_addr_any.c | 3 --- tools/testing/selftests/net/reuseport_bpf_cpu.c | 3 --- tools/testing/selftests/net/reuseport_bpf_numa.c | 3 --- tools/testing/selftests/net/reuseport_dualstack.c | 3 --- tools/testing/selftests/net/so_incoming_cpu.c | 1 - tools/testing/selftests/net/so_netns_cookie.c | 1 - tools/testing/selftests/net/so_txtime.c | 3 --- tools/testing/selftests/net/tap.c | 3 --- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- tools/testing/selftests/net/tcp_fastopen_backup_key.c | 1 - tools/testing/selftests/net/tcp_inq.c | 2 -- tools/testing/selftests/net/tcp_mmap.c | 1 - tools/testing/selftests/net/tls.c | 3 --- tools/testing/selftests/net/toeplitz.c | 3 --- tools/testing/selftests/net/tun.c | 3 --- tools/testing/selftests/net/txring_overwrite.c | 3 --- tools/testing/selftests/net/txtimestamp.c | 3 --- tools/testing/selftests/net/udpgso.c | 3 --- tools/testing/selftests/net/udpgso_bench_rx.c | 3 --- tools/testing/selftests/net/udpgso_bench_tx.c | 3 --- tools/testing/selftests/nolibc/nolibc-test.c | 2 -- tools/testing/selftests/nsfs/owner.c | 1 - tools/testing/selftests/nsfs/pidns.c | 1 - tools/testing/selftests/openat2/helpers.c | 2 -- tools/testing/selftests/openat2/helpers.h | 1 - tools/testing/selftests/openat2/openat2_test.c | 2 -- tools/testing/selftests/openat2/rename_attack_test.c | 2 -- tools/testing/selftests/openat2/resolve_test.c | 2 -- tools/testing/selftests/perf_events/remove_on_exec.c | 2 -- tools/testing/selftests/perf_events/sigtrap_threads.c | 2 -- tools/testing/selftests/perf_events/watermark_signal.c | 2 -- tools/testing/selftests/pid_namespace/regression_enomem.c | 1 - tools/testing/selftests/pidfd/pidfd.h | 1 - tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_getfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_open_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_poll_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_wait.c | 2 -- tools/testing/selftests/powerpc/benchmarks/context_switch.c | 2 -- tools/testing/selftests/powerpc/benchmarks/exec_target.c | 2 -- tools/testing/selftests/powerpc/benchmarks/fork.c | 2 -- tools/testing/selftests/powerpc/benchmarks/futex_bench.c | 3 --- tools/testing/selftests/powerpc/dexcr/hashchk_test.c | 3 --- tools/testing/selftests/powerpc/dscr/dscr_default_test.c | 3 --- tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c | 3 --- tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c | 1 - tools/testing/selftests/powerpc/mm/exec_prot.c | 2 -- tools/testing/selftests/powerpc/mm/pkey_exec_prot.c | 2 -- tools/testing/selftests/powerpc/mm/pkey_siginfo.c | 2 -- tools/testing/selftests/powerpc/mm/tlbie_test.c | 2 -- tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c | 1 - tools/testing/selftests/powerpc/pmu/count_instructions.c | 3 --- tools/testing/selftests/powerpc/pmu/count_stcx_fail.c | 3 --- tools/testing/selftests/powerpc/pmu/ebb/ebb.c | 3 --- .../selftests/powerpc/pmu/ebb/instruction_count_test.c | 3 --- tools/testing/selftests/powerpc/pmu/event.c | 2 -- tools/testing/selftests/powerpc/pmu/lib.c | 3 --- tools/testing/selftests/powerpc/pmu/per_event_excludes.c | 3 --- tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c | 3 --- tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c | 2 -- .../testing/selftests/powerpc/signal/sig_sc_double_restart.c | 1 - tools/testing/selftests/powerpc/signal/sigreturn_kernel.c | 3 --- tools/testing/selftests/powerpc/signal/sigreturn_vdso.c | 3 --- tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c | 2 -- tools/testing/selftests/powerpc/tm/tm-exec.c | 2 -- tools/testing/selftests/powerpc/tm/tm-poison.c | 2 -- .../testing/selftests/powerpc/tm/tm-signal-context-force-tm.c | 2 -- tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c | 2 -- tools/testing/selftests/powerpc/tm/tm-tmspr.c | 2 -- tools/testing/selftests/powerpc/tm/tm-trap.c | 2 -- tools/testing/selftests/powerpc/tm/tm-unavailable.c | 2 -- tools/testing/selftests/powerpc/utils.c | 3 --- tools/testing/selftests/proc/Makefile | 1 - tools/testing/selftests/proc/proc-empty-vm.c | 3 --- tools/testing/selftests/ptp/testptp.c | 1 - tools/testing/selftests/ptrace/get_set_sud.c | 1 - tools/testing/selftests/ptrace/peeksiginfo.c | 1 - tools/testing/selftests/resctrl/Makefile | 2 +- tools/testing/selftests/riscv/hwprobe/cbo.c | 1 - tools/testing/selftests/riscv/hwprobe/which-cpus.c | 1 - tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/rlimits/rlimits-per-userns.c | 1 - tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- tools/testing/selftests/safesetid/safesetid-test.c | 1 - tools/testing/selftests/sched/cs_prctl_test.c | 2 -- tools/testing/selftests/seccomp/seccomp_benchmark.c | 1 - tools/testing/selftests/seccomp/seccomp_bpf.c | 2 -- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/sigstruct.c | 1 - tools/testing/selftests/sigaltstack/sas.c | 2 -- tools/testing/selftests/splice/default_file_splice_read.c | 1 - tools/testing/selftests/splice/splice_read.c | 1 - tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c | 2 -- tools/testing/selftests/syscall_user_dispatch/sud_test.c | 2 -- .../selftests/thermal/intel/power_floor/power_floor_test.c | 3 --- .../thermal/intel/workload_hint/workload_hint_test.c | 3 --- tools/testing/selftests/timens/clock_nanosleep.c | 1 - tools/testing/selftests/timens/exec.c | 1 - tools/testing/selftests/timens/futex.c | 1 - tools/testing/selftests/timens/gettime_perf.c | 1 - tools/testing/selftests/timens/procfs.c | 1 - tools/testing/selftests/timens/timens.c | 1 - tools/testing/selftests/timens/timer.c | 1 - tools/testing/selftests/timens/timerfd.c | 1 - tools/testing/selftests/timens/vfork_exec.c | 1 - tools/testing/selftests/tmpfs/Makefile | 1 - tools/testing/selftests/uevent/uevent_filtering.c | 2 -- tools/testing/selftests/user_events/abi_test.c | 2 -- tools/testing/selftests/vDSO/vdso_test_abi.c | 1 - tools/testing/selftests/vDSO/vdso_test_clock_getres.c | 2 -- tools/testing/selftests/vDSO/vdso_test_correctness.c | 3 --- tools/testing/selftests/wireguard/qemu/init.c | 2 -- tools/testing/selftests/x86/amx.c | 2 -- tools/testing/selftests/x86/check_initial_reg_state.c | 3 --- tools/testing/selftests/x86/corrupt_xstate_header.c | 3 --- tools/testing/selftests/x86/entry_from_vm86.c | 3 --- tools/testing/selftests/x86/fsgsbase.c | 2 -- tools/testing/selftests/x86/fsgsbase_restore.c | 2 -- tools/testing/selftests/x86/ioperm.c | 2 -- tools/testing/selftests/x86/iopl.c | 2 -- tools/testing/selftests/x86/lam.c | 1 - tools/testing/selftests/x86/ldt_gdt.c | 2 -- tools/testing/selftests/x86/mov_ss_trap.c | 2 -- tools/testing/selftests/x86/nx_stack.c | 2 -- tools/testing/selftests/x86/ptrace_syscall.c | 2 -- tools/testing/selftests/x86/sigaltstack.c | 2 -- tools/testing/selftests/x86/sigreturn.c | 3 --- tools/testing/selftests/x86/single_step_syscall.c | 3 --- tools/testing/selftests/x86/syscall_arg_fault.c | 3 --- tools/testing/selftests/x86/syscall_numbering.c | 3 --- tools/testing/selftests/x86/sysret_rip.c | 3 --- tools/testing/selftests/x86/sysret_ss_attrs.c | 3 --- tools/testing/selftests/x86/test_FCMOV.c | 4 ---- tools/testing/selftests/x86/test_FCOMI.c | 4 ---- tools/testing/selftests/x86/test_FISTTP.c | 4 ---- tools/testing/selftests/x86/test_mremap_vdso.c | 1 - tools/testing/selftests/x86/test_shadow_stack.c | 3 --- tools/testing/selftests/x86/test_syscall_vdso.c | 4 ---- tools/testing/selftests/x86/test_vsyscall.c | 3 --- tools/testing/selftests/x86/unwind_vdso.c | 3 --- tools/testing/selftests/x86/vdso_restorer.c | 3 --- 323 files changed, 11 insertions(+), 611 deletions(-)
--
2.45.0.118.g7fe29c98d7-goog
PATCH v3 1/68 selftests: Compile kselftest headers with -D_GNU_SOURCE
Add the -D_GNU_SOURCE flag to KHDR_INCLUDES so that it is defined in a central location.
809216233555 ("selftests/harness: remove use of LINE_MAX") introduced asprintf into kselftest_harness.h, which is a GNU extension and needs _GNU_SOURCE to either be defined prior to including headers or with the -D_GNU_SOURCE flag passed to the compiler.
--- tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/kselftest_harness.h | 2 +- tools/testing/selftests/lib.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/Makefile +2 -2
@@ -170,11 +170,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endif
tools/testing/selftests/kselftest_harness.h +1 -1
@@ -51,7 +51,7 @@#define __KSELFTEST_HARNESS_H#ifndef _GNU_SOURCE -#define _GNU_SOURCE +static_assert (0 ,"kselftest harness requires _GNU_SOURCE to be defined" );#endif #include <asm/types.h> #include <ctype.h>
tools/testing/selftests/lib.mk +1 -1
@@ -67,7 +67,7 @@ MAKEFLAGS += --no-print-directory endif ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include endif # In order to use newer items that haven't yet been added to the user's system
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 2/68 selftests/sgx: Include KHDR_INCLUDES in Makefile
In reply to Edward LiawAdd KHDR_INCLUDES to the CFLAGS to pull in the kselftest harness dependencies (-D_GNU_SOURCE).
Also, remove redefinitions of _GNU_SOURCE in the source code.
--- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/sgx/sigstruct.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/sgx/Makefile +1 -1
@@ -12,7 +12,7 @@ OBJCOPY := $(CROSS_COMPILE)objcopy endif INCLUDES := -I$(top_srcdir)/tools/include -HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC +HOST_CFLAGS := -Wall -Werror $(KHDR_INCLUDES) -g $(INCLUDES) -fPIC HOST_LDFLAGS := -z noexecstack -lcrypto ENCL_CFLAGS += -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE \ -fno-stack-protector -mrdrnd $(INCLUDES)
tools/testing/selftests/sgx/sigstruct.c +0 -1
@@ -1,7 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2016-20 Intel Corporation. */ -#define _GNU_SOURCE#include <assert.h> #include <getopt.h> #include <stdbool.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 3/68 selftests: Compile with -D_GNU_SOURCE when including lib.mk
In reply to Edward Liawlib.mk will add -D_GNU_SOURCE to CFLAGS by default. This will make it unnecessary to add #define _GNU_SOURCE in the source code.
--- tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/lib.mk | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-)
tools/testing/selftests/Makefile +2 -2
@@ -170,11 +170,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include DEFAULT_INSTALL_HDR_PATH := 1 endif
tools/testing/selftests/lib.mk +4 -1
@@ -67,7 +67,7 @@ MAKEFLAGS += --no-print-directory endif ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include endif # In order to use newer items that haven't yet been added to the user's system
@@ -188,6 +188,9 @@ endef clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) $(CLEAN) +# Build with _GNU_SOURCE by default +CFLAGS += -D_GNU_SOURCE + # Enables to extend CFLAGS and LDFLAGS from command line, e.g. # make USERCFLAGS=-Werror USERLDFLAGS=-static CFLAGS += $(USERCFLAGS)
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 4/68 selftests/arm64: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/arm64/fp/fp-ptrace.c | 3 --- tools/testing/selftests/arm64/fp/fp-stress.c | 2 -- tools/testing/selftests/arm64/fp/vlset.c | 1 - tools/testing/selftests/arm64/mte/check_buffer_fill.c | 3 --- tools/testing/selftests/arm64/mte/check_child_memory.c | 3 --- tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c | 3 --- tools/testing/selftests/arm64/mte/check_ksm_options.c | 3 --- tools/testing/selftests/arm64/mte/check_mmap_options.c | 3 --- tools/testing/selftests/arm64/mte/check_tags_inclusion.c | 3 --- tools/testing/selftests/arm64/mte/check_user_mem.c | 3 --- tools/testing/selftests/arm64/pauth/pac.c | 3 --- 11 files changed, 30 deletions(-)
tools/testing/selftests/arm64/fp/fp-ptrace.c +0 -3
@@ -3,9 +3,6 @@* Copyright (C) 2023 ARM Limited. * Original author: Mark Brown <[email protected]> */ - -#define _GNU_SOURCE -#include <errno.h> #include <stdbool.h> #include <stddef.h>
tools/testing/selftests/arm64/fp/fp-stress.c +0 -2
@@ -2,8 +2,6 @@/* * Copyright (C) 2022 ARM Limited. */ - -#define _GNU_SOURCE#define _POSIX_C_SOURCE 199309L#include <errno.h>
tools/testing/selftests/arm64/fp/vlset.c +0 -1
@@ -3,7 +3,6 @@* Copyright (C) 2015-2019 ARM Limited. * Original author: Dave Martin <[email protected]> */ -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <limits.h>
tools/testing/selftests/arm64/mte/check_buffer_fill.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2020 ARM Limited - -#define _GNU_SOURCE -#include <stddef.h> #include <stdio.h> #include <string.h>
tools/testing/selftests/arm64/mte/check_child_memory.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2020 ARM Limited - -#define _GNU_SOURCE -#include <errno.h> #include <signal.h> #include <stdio.h>
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2020 ARM Limited - -#define _GNU_SOURCE -#include <errno.h> #include <pthread.h> #include <stdint.h>
tools/testing/selftests/arm64/mte/check_ksm_options.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2020 ARM Limited - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <signal.h>
tools/testing/selftests/arm64/mte/check_mmap_options.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2020 ARM Limited - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <signal.h>
tools/testing/selftests/arm64/mte/check_tags_inclusion.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2020 ARM Limited - -#define _GNU_SOURCE -#include <errno.h> #include <signal.h> #include <stdio.h>
tools/testing/selftests/arm64/mte/check_user_mem.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2020 ARM Limited - -#define _GNU_SOURCE -#include <assert.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/arm64/pauth/pac.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2020 ARM Limited - -#define _GNU_SOURCE -#include <sys/auxv.h> #include <sys/types.h> #include <sys/wait.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 5/68 selftests/arm64: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/arm64/signal/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/arm64/signal/Makefile +1 -1
@@ -2,7 +2,7 @@ # Copyright (C) 2019 ARM Limited # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += -std=gnu99 -I. SRCS := $(filter-out testcases/testcases.c,$(wildcard testcases/*.c)) PROGS := $(patsubst %.c,%,$(SRCS))
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 6/68 selftests/bpf: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/bpf/bench.c | 1 - tools/testing/selftests/bpf/benchs/bench_trigger.c | 1 - tools/testing/selftests/bpf/cgroup_helpers.c | 1 - tools/testing/selftests/bpf/map_tests/task_storage_map.c | 1 - tools/testing/selftests/bpf/network_helpers.c | 2 -- tools/testing/selftests/bpf/prog_tests/bind_perm.c | 1 - tools/testing/selftests/bpf/prog_tests/bpf_cookie.c | 1 - tools/testing/selftests/bpf/prog_tests/bpf_iter_setsockopt.c | 1 - tools/testing/selftests/bpf/prog_tests/bpf_obj_pinning.c | 1 - tools/testing/selftests/bpf/prog_tests/btf_endian.c | 1 - tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c | 2 -- tools/testing/selftests/bpf/prog_tests/cgrp_kfunc.c | 2 -- tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c | 2 -- tools/testing/selftests/bpf/prog_tests/cls_redirect.c | 3 --- tools/testing/selftests/bpf/prog_tests/connect_ping.c | 2 -- tools/testing/selftests/bpf/prog_tests/core_retro.c | 1 - tools/testing/selftests/bpf/prog_tests/d_path.c | 1 - tools/testing/selftests/bpf/prog_tests/deny_namespace.c | 1 - tools/testing/selftests/bpf/prog_tests/fexit_sleep.c | 1 - .../testing/selftests/bpf/prog_tests/flow_dissector_reattach.c | 2 -- tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c | 1 - tools/testing/selftests/bpf/prog_tests/htab_reuse.c | 1 - tools/testing/selftests/bpf/prog_tests/htab_update.c | 1 - tools/testing/selftests/bpf/prog_tests/map_in_map.c | 1 - tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c | 2 -- tools/testing/selftests/bpf/prog_tests/perf_branches.c | 1 - tools/testing/selftests/bpf/prog_tests/perf_buffer.c | 1 - tools/testing/selftests/bpf/prog_tests/perf_event_stackmap.c | 1 - tools/testing/selftests/bpf/prog_tests/perf_link.c | 1 - tools/testing/selftests/bpf/prog_tests/perf_skip.c | 2 -- tools/testing/selftests/bpf/prog_tests/preempted_bpf_ma_op.c | 1 - tools/testing/selftests/bpf/prog_tests/rcu_read_lock.c | 2 -- tools/testing/selftests/bpf/prog_tests/reg_bounds.c | 2 -- tools/testing/selftests/bpf/prog_tests/ringbuf.c | 1 - tools/testing/selftests/bpf/prog_tests/ringbuf_multi.c | 1 - tools/testing/selftests/bpf/prog_tests/setget_sockopt.c | 2 -- tools/testing/selftests/bpf/prog_tests/sk_assign.c | 2 -- tools/testing/selftests/bpf/prog_tests/sk_lookup.c | 2 -- tools/testing/selftests/bpf/prog_tests/sock_fields.c | 2 -- tools/testing/selftests/bpf/prog_tests/task_kfunc.c | 2 -- tools/testing/selftests/bpf/prog_tests/task_local_storage.c | 2 -- tools/testing/selftests/bpf/prog_tests/task_pt_regs.c | 1 - tools/testing/selftests/bpf/prog_tests/tcp_custom_syncookie.c | 2 -- tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c | 2 -- tools/testing/selftests/bpf/prog_tests/test_bpf_ma.c | 1 - .../testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c | 1 - tools/testing/selftests/bpf/prog_tests/test_bpffs.c | 1 - tools/testing/selftests/bpf/prog_tests/test_overhead.c | 1 - tools/testing/selftests/bpf/prog_tests/token.c | 1 - tools/testing/selftests/bpf/prog_tests/trace_ext.c | 2 -- tools/testing/selftests/bpf/prog_tests/trampoline_count.c | 1 - tools/testing/selftests/bpf/prog_tests/user_ringbuf.c | 2 -- tools/testing/selftests/bpf/prog_tests/xdp_bonding.c | 2 -- tools/testing/selftests/bpf/prog_tests/xdp_synproxy.c | 2 -- tools/testing/selftests/bpf/test_flow_dissector.c | 3 --- tools/testing/selftests/bpf/test_lru_map.c | 1 - tools/testing/selftests/bpf/test_progs.c | 1 - tools/testing/selftests/bpf/test_sock_addr.c | 3 --- tools/testing/selftests/bpf/test_tcpnotify_user.c | 1 - tools/testing/selftests/bpf/veristat.c | 1 - tools/testing/selftests/bpf/xskxceiver.c | 2 -- 61 files changed, 90 deletions(-)
tools/testing/selftests/bpf/bench.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2020 Facebook */ -#define _GNU_SOURCE#include <argp.h> #include <linux/compiler.h> #include <sys/time.h>
tools/testing/selftests/bpf/benchs/bench_trigger.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2020 Facebook */ -#define _GNU_SOURCE#include <argp.h> #include <unistd.h> #include <stdint.h>
tools/testing/selftests/bpf/cgroup_helpers.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <sys/mount.h> #include <sys/stat.h>
tools/testing/selftests/bpf/map_tests/task_storage_map.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2022. Huawei Technologies Co., Ltd */ -#define _GNU_SOURCE#include <sched.h> #include <unistd.h> #include <stdlib.h>
tools/testing/selftests/bpf/network_helpers.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE -#include <errno.h> #include <stdbool.h> #include <stdio.h>
tools/testing/selftests/bpf/prog_tests/bind_perm.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdlib.h> #include <sys/types.h>
tools/testing/selftests/bpf/prog_tests/bpf_cookie.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2021 Facebook */ -#define _GNU_SOURCE#include <pthread.h> #include <sched.h> #include <sys/syscall.h>
tools/testing/selftests/bpf/prog_tests/bpf_iter_setsockopt.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2021 Facebook */ -#define _GNU_SOURCE#include <sched.h> #include <test_progs.h> #include "network_helpers.h"
tools/testing/selftests/bpf/prog_tests/bpf_obj_pinning.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */ -#define _GNU_SOURCE#include <test_progs.h> #include <bpf/btf.h> #include <fcntl.h>
tools/testing/selftests/bpf/prog_tests/btf_endian.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2020 Facebook */ -#define _GNU_SOURCE#include <string.h> #include <byteswap.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2020 Facebook */ - -#define _GNU_SOURCE#include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h>
tools/testing/selftests/bpf/prog_tests/cgrp_kfunc.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */ - -#define _GNU_SOURCE#include <cgroup_helpers.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates.*/ - -#define _GNU_SOURCE#include <unistd.h> #include <sys/syscall.h> #include <sys/types.h>
tools/testing/selftests/bpf/prog_tests/cls_redirect.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause // Copyright (c) 2020 Cloudflare - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <string.h>
tools/testing/selftests/bpf/prog_tests/connect_ping.c +0 -2
@@ -3,8 +3,6 @@/* * Copyright 2022 Google LLC. */ - -#define _GNU_SOURCE#include <sys/mount.h> #include "test_progs.h"
tools/testing/selftests/bpf/prog_tests/core_retro.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2020 Facebook -#define _GNU_SOURCE#include <test_progs.h> #include "test_core_retro.skel.h"
tools/testing/selftests/bpf/prog_tests/d_path.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <test_progs.h> #include <sys/stat.h> #include <linux/sched.h>
tools/testing/selftests/bpf/prog_tests/deny_namespace.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <test_progs.h> #include "test_deny_namespace.skel.h" #include <sched.h>
tools/testing/selftests/bpf/prog_tests/fexit_sleep.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2021 Facebook */ -#define _GNU_SOURCE#include <sched.h> #include <test_progs.h> #include <time.h>
tools/testing/selftests/bpf/prog_tests/flow_dissector_reattach.c +0 -2
@@ -2,8 +2,6 @@/* * Tests for attaching, detaching, and replacing flow_dissector BPF program. */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <pthread.h> #include <sched.h> #include <sys/socket.h>
tools/testing/selftests/bpf/prog_tests/htab_reuse.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2023. Huawei Technologies Co., Ltd */ -#define _GNU_SOURCE#include <sched.h> #include <stdbool.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/htab_update.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2022. Huawei Technologies Co., Ltd */ -#define _GNU_SOURCE#include <sched.h> #include <stdbool.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/map_in_map.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2023. Huawei Technologies Co., Ltd */ -#define _GNU_SOURCE#include <unistd.h> #include <sys/syscall.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2020 Carlos Neira [email protected] */ - -#define _GNU_SOURCE#include <test_progs.h> #include "test_ns_current_pid_tgid.skel.h" #include <sys/stat.h>
tools/testing/selftests/bpf/prog_tests/perf_branches.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <pthread.h> #include <sched.h> #include <sys/socket.h>
tools/testing/selftests/bpf/prog_tests/perf_buffer.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <pthread.h> #include <sched.h> #include <sys/socket.h>
tools/testing/selftests/bpf/prog_tests/perf_event_stackmap.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2020 Facebook -#define _GNU_SOURCE#include <pthread.h> #include <sched.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/perf_link.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2021 Facebook */ -#define _GNU_SOURCE#include <pthread.h> #include <sched.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/perf_skip.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <test_progs.h> #include "test_perf_skip.skel.h" #include <linux/compiler.h>
tools/testing/selftests/bpf/prog_tests/preempted_bpf_ma_op.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2023. Huawei Technologies Co., Ltd */ -#define _GNU_SOURCE#include <sched.h> #include <pthread.h> #include <stdbool.h>
tools/testing/selftests/bpf/prog_tests/rcu_read_lock.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates.*/ - -#define _GNU_SOURCE#include <unistd.h> #include <sys/syscall.h> #include <sys/types.h>
tools/testing/selftests/bpf/prog_tests/reg_bounds.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */ - -#define _GNU_SOURCE#include <limits.h> #include <test_progs.h> #include <linux/filter.h>
tools/testing/selftests/bpf/prog_tests/ringbuf.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/compiler.h> #include <asm/barrier.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/ringbuf_multi.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <test_progs.h> #include <sys/epoll.h> #include "test_ringbuf_multi.skel.h"
tools/testing/selftests/bpf/prog_tests/setget_sockopt.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) Meta Platforms, Inc. and affiliates. */ - -#define _GNU_SOURCE#include <sched.h> #include <linux/socket.h> #include <linux/tls.h>
tools/testing/selftests/bpf/prog_tests/sk_assign.c +0 -2
@@ -7,8 +7,6 @@* socket, regardless of whether the port or address destination of the traffic * matches the port. */ - -#define _GNU_SOURCE#include <fcntl.h> #include <signal.h> #include <stdlib.h>
tools/testing/selftests/bpf/prog_tests/sk_lookup.c +0 -2
@@ -13,8 +13,6 @@* * Tests run in a dedicated network namespace. */ - -#define _GNU_SOURCE#include <arpa/inet.h> #include <assert.h> #include <errno.h>
tools/testing/selftests/bpf/prog_tests/sock_fields.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2019 Facebook */ - -#define _GNU_SOURCE#include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h>
tools/testing/selftests/bpf/prog_tests/task_kfunc.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */ - -#define _GNU_SOURCE#include <sys/wait.h> #include <test_progs.h> #include <unistd.h>
tools/testing/selftests/bpf/prog_tests/task_local_storage.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2021 Facebook */ - -#define _GNU_SOURCE/* See feature_test_macros(7) */ #include <unistd.h> #include <sched.h> #include <pthread.h>
tools/testing/selftests/bpf/prog_tests/task_pt_regs.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <test_progs.h> #include "test_task_pt_regs.skel.h"
tools/testing/selftests/bpf/prog_tests/tcp_custom_syncookie.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ - -#define _GNU_SOURCE#include <sched.h> #include <stdlib.h> #include <net/if.h>
tools/testing/selftests/bpf/prog_tests/tcp_hdr_options.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2020 Facebook */ - -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/bpf/prog_tests/test_bpf_ma.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (C) 2023. Huawei Technologies Co., Ltd */ -#define _GNU_SOURCE#include <sched.h> #include <pthread.h> #include <stdbool.h>
tools/testing/selftests/bpf/prog_tests/test_bpf_syscall_macro.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright 2022 Sony Group Corporation */ -#define _GNU_SOURCE#include <fcntl.h> #include <sys/prctl.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/test_bpffs.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2020 Facebook */ -#define _GNU_SOURCE#include <stdio.h> #include <sched.h> #include <sys/mount.h>
tools/testing/selftests/bpf/prog_tests/test_overhead.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2019 Facebook */ -#define _GNU_SOURCE#include <sched.h> #include <sys/prctl.h> #include <test_progs.h>
tools/testing/selftests/bpf/prog_tests/token.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */ -#define _GNU_SOURCE#include <test_progs.h> #include <bpf/btf.h> #include "cap_helpers.h"
tools/testing/selftests/bpf/prog_tests/trace_ext.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <test_progs.h> #include <network_helpers.h> #include <sys/stat.h>
tools/testing/selftests/bpf/prog_tests/trampoline_count.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE#include <test_progs.h> struct inst {
tools/testing/selftests/bpf/prog_tests/user_ringbuf.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */ - -#define _GNU_SOURCE#include <linux/compiler.h> #include <linux/ring_buffer.h> #include <pthread.h>
tools/testing/selftests/bpf/prog_tests/xdp_bonding.c +0 -2
@@ -8,8 +8,6 @@* are correctly loaded onto the slave devices and XDP_TX'd * packets are balanced using bonding. */ - -#define _GNU_SOURCE#include <sched.h> #include <net/if.h> #include <linux/if_link.h>
tools/testing/selftests/bpf/prog_tests/xdp_synproxy.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ - -#define _GNU_SOURCE#include <test_progs.h> #include <network_helpers.h> #include <ctype.h>
tools/testing/selftests/bpf/test_flow_dissector.c +0 -3
@@ -6,9 +6,6 @@* GRE/GUE/BARE outer layer 4, where bare is IPIP/SIT/IPv4-in-IPv6/.. * IPv4/IPv6 inner layer 3 */ - -#define _GNU_SOURCE -#include <stddef.h> #include <arpa/inet.h> #include <asm/byteorder.h>
tools/testing/selftests/bpf/test_lru_map.c +0 -1
@@ -2,7 +2,6 @@/* * Copyright (c) 2016 Facebook */ -#define _GNU_SOURCE#include <stdio.h> #include <unistd.h> #include <errno.h>
tools/testing/selftests/bpf/test_progs.c +0 -1
@@ -1,7 +1,6 @@// SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2017 Facebook */ -#define _GNU_SOURCE#include "test_progs.h" #include "testing_helpers.h" #include "cgroup_helpers.h"
tools/testing/selftests/bpf/test_sock_addr.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2018 Facebook - -#define _GNU_SOURCE -#include <stdio.h> #include <stdlib.h> #include <unistd.h>
tools/testing/selftests/bpf/test_tcpnotify_user.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <pthread.h> #include <inttypes.h> #include <stdio.h>
tools/testing/selftests/bpf/veristat.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */ -#define _GNU_SOURCE#include <argp.h> #include <string.h> #include <stdlib.h>
tools/testing/selftests/bpf/xskxceiver.c +0 -2
@@ -70,8 +70,6 @@* To enable L2 - L4 headers and payload dump of each packet on STDOUT, add * parameter -D to params array in test_xsk.sh, i.e. params=("-S" "-D") */ - -#define _GNU_SOURCE#include <assert.h> #include <fcntl.h> #include <errno.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 7/68 selftests/breakpoints: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/breakpoints/breakpoint_test_arm64.c | 3 --- tools/testing/selftests/breakpoints/step_after_suspend_test.c | 3 --- 2 files changed, 6 deletions(-)
tools/testing/selftests/breakpoints/breakpoint_test_arm64.c +0 -3
@@ -7,9 +7,6 @@* Code modified by Pratyush Anand <[email protected]> * for testing different byte select for each access size. */ - -#define _GNU_SOURCE -#include <asm/ptrace.h> #include <sys/types.h> #include <sys/wait.h>
tools/testing/selftests/breakpoints/step_after_suspend_test.c +0 -3
@@ -2,9 +2,6 @@/* * Copyright (C) 2016 Google, Inc. */ - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <sched.h>
--
2.45.0.118.g7fe29c98d7-goog
PATCH v3 8/68 selftests/cachestat: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/cachestat/test_cachestat.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/cachestat/test_cachestat.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdbool.h> #include <linux/kernel.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 9/68 selftests/capabilities: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/capabilities/test_execve.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/capabilities/test_execve.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <cap-ng.h> #include <linux/capability.h> #include <stdbool.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 10/68 selftests/cgroup: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/cgroup/cgroup_util.c | 3 --- tools/testing/selftests/cgroup/test_core.c | 2 -- tools/testing/selftests/cgroup/test_cpu.c | 2 -- tools/testing/selftests/cgroup/test_hugetlb_memcg.c | 2 -- tools/testing/selftests/cgroup/test_kmem.c | 2 -- tools/testing/selftests/cgroup/test_memcontrol.c | 2 -- tools/testing/selftests/cgroup/test_zswap.c | 2 -- 7 files changed, 15 deletions(-)
tools/testing/selftests/cgroup/cgroup_util.c +0 -3
@@ -1,7 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <linux/limits.h>
tools/testing/selftests/cgroup/test_core.c +0 -2
@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <linux/limits.h> #include <linux/sched.h> #include <sys/types.h>
tools/testing/selftests/cgroup/test_cpu.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <linux/limits.h> #include <sys/sysinfo.h> #include <sys/wait.h>
tools/testing/selftests/cgroup/test_hugetlb_memcg.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <linux/limits.h> #include <sys/mman.h> #include <stdio.h>
tools/testing/selftests/cgroup/test_kmem.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <linux/limits.h> #include <fcntl.h> #include <stdio.h>
tools/testing/selftests/cgroup/test_memcontrol.c +0 -2
@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ -#define _GNU_SOURCE -#include <linux/limits.h> #include <linux/oom.h> #include <fcntl.h>
tools/testing/selftests/cgroup/test_zswap.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <linux/limits.h> #include <unistd.h> #include <stdio.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 11/68 selftests/clone3: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/clone3/clone3.c | 2 -- tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 2 -- tools/testing/selftests/clone3/clone3_clear_sighand.c | 2 -- tools/testing/selftests/clone3/clone3_selftests.h | 1 - tools/testing/selftests/clone3/clone3_set_tid.c | 2 -- 5 files changed, 9 deletions(-)
tools/testing/selftests/clone3/clone3.c +0 -2
@@ -1,8 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* Based on Christian Brauner's clone3() example */ - -#define _GNU_SOURCE#include <errno.h> #include <inttypes.h> #include <linux/types.h>
tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c +0 -2
@@ -7,8 +7,6 @@*/ /* capabilities related code based on selftests/bpf/test_verifier.c */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <linux/sched.h>
tools/testing/selftests/clone3/clone3_clear_sighand.c +0 -2
@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <signal.h>
tools/testing/selftests/clone3/clone3_selftests.h +0 -1
@@ -3,7 +3,6 @@#ifndef _CLONE3_SELFTESTS_H#define _CLONE3_SELFTESTS_H -#define _GNU_SOURCE#include <sched.h> #include <linux/sched.h> #include <linux/types.h>
tools/testing/selftests/clone3/clone3_set_tid.c +0 -2
@@ -5,8 +5,6 @@* These tests are assuming to be running in the host's * PID namespace. */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <linux/sched.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 12/68 selftests/core: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/core/close_range_test.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/core/close_range_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/kernel.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 13/68 selftests/damon: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c | 3 --- .../damon/debugfs_target_ids_read_before_terminate_race.c | 2 -- 2 files changed, 5 deletions(-)
tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c +0 -3
@@ -2,9 +2,6 @@/* * Author: SeongJae Park <[email protected]> */ - -#define _GNU_SOURCE -#include <fcntl.h> #include <stdbool.h> #include <stdint.h>
tools/testing/selftests/damon/debugfs_target_ids_read_before_terminate_race.c +0 -2
@@ -2,8 +2,6 @@/* * Author: SeongJae Park <[email protected]> */ -#define _GNU_SOURCE -#include <fcntl.h> #include <stdbool.h> #include <stdint.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 14/68 selftests/drivers: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/drivers/dma-buf/udmabuf.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/drivers/dma-buf/udmabuf.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <stdio.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 15/68 selftests/exec: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/exec/Makefile | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/exec/Makefile +0 -1
@@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS = -Wall CFLAGS += -Wno-nonnull -CFLAGS += -D_GNU_SOURCE TEST_PROGS := binfmt_script.py TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216 non-regular
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 16/68 selftests/fchmodat2: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/fchmodat2/fchmodat2_test.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/fchmodat2/fchmodat2_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE#include <fcntl.h> #include <sys/stat.h> #include <sys/types.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 17/68 selftests/filelock: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/filelock/ofdlocks.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/filelock/ofdlocks.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <fcntl.h> #include <assert.h> #include <stdio.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 18/68 selftests/filesystems: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 2 -- tools/testing/selftests/filesystems/devpts_pts.c | 1 - tools/testing/selftests/filesystems/dnotify_test.c | 1 - tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c | 2 -- tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 2 -- tools/testing/selftests/filesystems/fat/rename_exchange.c | 2 -- tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c | 2 -- tools/testing/selftests/filesystems/statmount/statmount_test.c | 3 --- 8 files changed, 15 deletions(-)
tools/testing/selftests/filesystems/binderfs/binderfs_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <pthread.h>
tools/testing/selftests/filesystems/devpts_pts.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
tools/testing/selftests/filesystems/dnotify_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE/* needed to get the defines */ #include <fcntl.h> /* in glibc 2.2 this has the needed values defined */ #include <signal.h>
tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <asm/unistd.h> #include <linux/time_types.h> #include <poll.h>
tools/testing/selftests/filesystems/eventfd/eventfd_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <asm/unistd.h>
tools/testing/selftests/filesystems/fat/rename_exchange.c +0 -2
@@ -6,8 +6,6 @@* Copyright 2022 Red Hat Inc. * Author: Javier Martinez Canillas <[email protected]> */ - -#define _GNU_SOURCE#include <fcntl.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <inttypes.h> #include <unistd.h> #include <stdio.h>
tools/testing/selftests/filesystems/statmount/statmount_test.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0-or-later - -#define _GNU_SOURCE -#include <assert.h> #include <stdint.h> #include <sched.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 19/68 selftests/firmware: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/firmware/fw_namespace.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/firmware/fw_namespace.c +0 -1
@@ -2,7 +2,6 @@/* Test triggering of loading of firmware from different mount * namespaces. Expect firmware to be always loaded from the mount * namespace of PID 1. */ -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 20/68 selftests/fpu: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/fpu/test_fpu.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/fpu/test_fpu.c +0 -2
@@ -4,8 +4,6 @@* module to perform floating point operations in the kernel. The control * register value should be independent between kernel and user mode. */ - -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <string.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 21/68 selftests/futex: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/futex/functional/futex_requeue_pi.c | 3 --- 1 file changed, 3 deletions(-)
tools/testing/selftests/futex/functional/futex_requeue_pi.c +0 -3
@@ -16,9 +16,6 @@* 2009-Nov-6: futex test adaptation by Darren Hart <[email protected]> * *****************************************************************************/ - -#define _GNU_SOURCE -#include <errno.h> #include <limits.h> #include <pthread.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 22/68 selftests/futex: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/futex/functional/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/futex/functional/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) -CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) +CFLAGS := $(CFLAGS) -g -O2 -Wall -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt LOCAL_HDRS := \
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 23/68 selftests/intel_pstate: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/intel_pstate/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/intel_pstate/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE +CFLAGS := $(CFLAGS) -Wall LDLIBS += -lm ARCH ?= $(shell uname -m 2>/dev/null || echo not)
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 24/68 selftests/iommu: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/iommu/Makefile | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/iommu/Makefile +0 -2
@@ -2,8 +2,6 @@ CFLAGS += -Wall -O2 -Wno-unused-function CFLAGS += $(KHDR_INCLUDES) -CFLAGS += -D_GNU_SOURCE - TEST_GEN_PROGS := TEST_GEN_PROGS += iommufd TEST_GEN_PROGS += iommufd_fail_nth
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 25/68 selftests/ipc: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/ipc/msgque.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/ipc/msgque.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <string.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 26/68 selftests/kcmp: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/kcmp/kcmp_test.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/kcmp/kcmp_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <stdio.h> #include <stdlib.h> #include <signal.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 27/68 selftests/landlock: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/landlock/base_test.c | 2 -- tools/testing/selftests/landlock/fs_test.c | 2 -- tools/testing/selftests/landlock/net_test.c | 2 -- tools/testing/selftests/landlock/ptrace_test.c | 2 -- 4 files changed, 8 deletions(-)
tools/testing/selftests/landlock/base_test.c +0 -2
@@ -5,8 +5,6 @@* Copyright © 2017-2020 Mickaël Salaün <[email protected]> * Copyright © 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h>
tools/testing/selftests/landlock/fs_test.c +0 -2
@@ -6,8 +6,6 @@* Copyright © 2020 ANSSI * Copyright © 2020-2022 Microsoft Corporation */ - -#define _GNU_SOURCE#include <asm/termbits.h> #include <fcntl.h> #include <libgen.h>
tools/testing/selftests/landlock/net_test.c +0 -2
@@ -5,8 +5,6 @@* Copyright © 2022-2023 Huawei Tech. Co., Ltd. * Copyright © 2023 Microsoft Corporation */ - -#define _GNU_SOURCE#include <arpa/inet.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/landlock/ptrace_test.c +0 -2
@@ -5,8 +5,6 @@* Copyright © 2017-2020 Mickaël Salaün <[email protected]> * Copyright © 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 28/68 selftests/lsm: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/lsm/common.c | 2 -- tools/testing/selftests/lsm/lsm_get_self_attr_test.c | 2 -- tools/testing/selftests/lsm/lsm_list_modules_test.c | 2 -- tools/testing/selftests/lsm/lsm_set_self_attr_test.c | 2 -- 4 files changed, 8 deletions(-)
tools/testing/selftests/lsm/common.c +0 -2
@@ -4,8 +4,6 @@* * Copyright © 2023 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <fcntl.h> #include <string.h>
tools/testing/selftests/lsm/lsm_get_self_attr_test.c +0 -2
@@ -5,8 +5,6 @@* * Copyright © 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <fcntl.h> #include <string.h>
tools/testing/selftests/lsm/lsm_list_modules_test.c +0 -2
@@ -5,8 +5,6 @@* * Copyright © 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <string.h> #include <stdio.h>
tools/testing/selftests/lsm/lsm_set_self_attr_test.c +0 -2
@@ -5,8 +5,6 @@* * Copyright © 2022 Casey Schaufler <[email protected]> */ - -#define _GNU_SOURCE#include <linux/lsm.h> #include <string.h> #include <stdio.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 29/68 selftests/membarrier: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/membarrier/membarrier_test_impl.h | 1 - .../testing/selftests/membarrier/membarrier_test_multi_thread.c | 1 - .../testing/selftests/membarrier/membarrier_test_single_thread.c | 1 - 3 files changed, 3 deletions(-)
tools/testing/selftests/membarrier/membarrier_test_impl.h +0 -1
@@ -1,5 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h>
tools/testing/selftests/membarrier/membarrier_test_multi_thread.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h>
tools/testing/selftests/membarrier/membarrier_test_single_thread.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/membarrier.h> #include <syscall.h> #include <stdio.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 30/68 selftests/memfd: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/memfd/common.c | 1 - tools/testing/selftests/memfd/fuse_test.c | 2 -- tools/testing/selftests/memfd/memfd_test.c | 1 - 3 files changed, 4 deletions(-)
tools/testing/selftests/memfd/common.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <stdio.h>
tools/testing/selftests/memfd/fuse_test.c +0 -2
@@ -12,8 +12,6 @@* the read() syscall with our memory-mapped memfd object as receive buffer to * force the kernel to write into our memfd object. */ - -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <errno.h>
tools/testing/selftests/memfd/memfd_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#define __EXPORTED_HEADERS__#include <errno.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 31/68 selftests/mincore: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/mincore/mincore_selftest.c | 3 --- 1 file changed, 3 deletions(-)
tools/testing/selftests/mincore/mincore_selftest.c +0 -3
@@ -4,9 +4,6 @@* * Copyright (C) 2020 Collabora, Ltd. */ - -#define _GNU_SOURCE -#include <stdio.h> #include <errno.h> #include <unistd.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 32/68 selftests/mm: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/mm/cow.c | 1 - tools/testing/selftests/mm/gup_longterm.c | 1 - tools/testing/selftests/mm/hugepage-mmap.c | 1 - tools/testing/selftests/mm/hugepage-mremap.c | 2 -- tools/testing/selftests/mm/hugetlb-madvise.c | 2 -- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 2 -- tools/testing/selftests/mm/khugepaged.c | 1 - tools/testing/selftests/mm/ksm_functional_tests.c | 1 - tools/testing/selftests/mm/madv_populate.c | 1 - tools/testing/selftests/mm/map_populate.c | 2 -- tools/testing/selftests/mm/mdwe_test.c | 1 - tools/testing/selftests/mm/memfd_secret.c | 2 -- tools/testing/selftests/mm/mlock2-tests.c | 1 - tools/testing/selftests/mm/mrelease_test.c | 1 - tools/testing/selftests/mm/mremap_dontunmap.c | 1 - tools/testing/selftests/mm/mremap_test.c | 2 -- tools/testing/selftests/mm/mseal_test.c | 1 - tools/testing/selftests/mm/pagemap_ioctl.c | 1 - tools/testing/selftests/mm/pkey-helpers.h | 1 - tools/testing/selftests/mm/protection_keys.c | 1 - tools/testing/selftests/mm/seal_elf.c | 1 - tools/testing/selftests/mm/split_huge_page_test.c | 2 -- tools/testing/selftests/mm/thuge-gen.c | 2 -- tools/testing/selftests/mm/uffd-common.h | 1 - 24 files changed, 32 deletions(-)
tools/testing/selftests/mm/cow.c +0 -1
@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h>
tools/testing/selftests/mm/gup_longterm.c +0 -1
@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h>
tools/testing/selftests/mm/hugepage-mmap.c +0 -1
@@ -16,7 +16,6 @@* range. * Other architectures, such as ppc64, i386 or x86_64 are not so constrained. */ -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h>
tools/testing/selftests/mm/hugepage-mremap.c +0 -2
@@ -11,8 +11,6 @@* To make sure the test triggers pmd sharing and goes through the 'unshare' * path in the mremap code use 1GB (1024) or more. */ - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h>
tools/testing/selftests/mm/hugetlb-madvise.c +0 -2
@@ -11,8 +11,6 @@* filesystem. Therefore, a hugetlbfs filesystem must be mounted on some * directory. */ - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <unistd.h>
tools/testing/selftests/mm/hugetlb-read-hwpoison.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <stdlib.h> #include <stdio.h> #include <string.h>
tools/testing/selftests/mm/khugepaged.c +0 -1
@@ -1,4 +1,3 @@ -#define _GNU_SOURCE#include <ctype.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/mm/ksm_functional_tests.c +0 -1
@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h>
tools/testing/selftests/mm/madv_populate.c +0 -1
@@ -6,7 +6,6 @@* * Author(s): David Hildenbrand <[email protected]> */ -#define _GNU_SOURCE#include <stdlib.h> #include <string.h> #include <stdbool.h>
tools/testing/selftests/mm/map_populate.c +0 -2
@@ -4,8 +4,6 @@* * MAP_POPULATE | MAP_PRIVATE should COW VMA pages. */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sys/mman.h>
tools/testing/selftests/mm/mdwe_test.c +0 -1
@@ -7,7 +7,6 @@#include <linux/mman.h> #include <linux/prctl.h> -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <sys/auxv.h>
tools/testing/selftests/mm/memfd_secret.c +0 -2
@@ -4,8 +4,6 @@* * Author: Mike Rapoport <[email protected]> */ - -#define _GNU_SOURCE#include <sys/uio.h> #include <sys/mman.h> #include <sys/wait.h>
tools/testing/selftests/mm/mlock2-tests.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sys/mman.h> #include <stdint.h> #include <unistd.h>
tools/testing/selftests/mm/mrelease_test.c +0 -1
@@ -2,7 +2,6 @@/* * Copyright 2022 Google LLC */ -#define _GNU_SOURCE#include <errno.h> #include <stdbool.h> #include <stdio.h>
tools/testing/selftests/mm/mremap_dontunmap.c +0 -1
@@ -5,7 +5,6 @@* * Copyright 2020, Brian Geffon <[email protected]> */ -#define _GNU_SOURCE#include <sys/mman.h> #include <linux/mman.h> #include <errno.h>
tools/testing/selftests/mm/mremap_test.c +0 -2
@@ -2,8 +2,6 @@/* * Copyright 2020 Google LLC */ -#define _GNU_SOURCE -#include <errno.h> #include <stdlib.h> #include <stdio.h>
tools/testing/selftests/mm/mseal_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <linux/mman.h> #include <sys/mman.h> #include <stdint.h>
tools/testing/selftests/mm/pagemap_ioctl.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <fcntl.h> #include <string.h>
tools/testing/selftests/mm/pkey-helpers.h +0 -1
@@ -1,7 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _PKEYS_HELPER_H#define _PKEYS_HELPER_H -#define _GNU_SOURCE#include <string.h> #include <stdarg.h> #include <stdio.h>
tools/testing/selftests/mm/protection_keys.c +0 -1
@@ -21,7 +21,6 @@* gcc -mxsave -o protection_keys -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm * gcc -mxsave -m32 -o protection_keys_32 -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm */ -#define _GNU_SOURCE#define __SANE_USERSPACE_TYPES__#include <errno.h> #include <linux/elf.h>
tools/testing/selftests/mm/seal_elf.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sys/mman.h> #include <stdint.h> #include <unistd.h>
tools/testing/selftests/mm/split_huge_page_test.c +0 -2
@@ -3,8 +3,6 @@* A test of splitting PMD THPs and PTE-mapped THPs from a specified virtual * address range in a process via <debugfs>/split_huge_pages interface. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdarg.h>
tools/testing/selftests/mm/thuge-gen.c +0 -2
@@ -12,8 +12,6 @@ipcrm -m by hand, like this sudo ipcs | awk '$1 == "0x00000000" {print $2}' | xargs -n1 sudo ipcrm -m (warning this will remove all if someone else uses them) */ - -#define _GNU_SOURCE 1#include <sys/mman.h> #include <stdlib.h> #include <stdio.h>
tools/testing/selftests/mm/uffd-common.h +0 -1
@@ -7,7 +7,6 @@#ifndef __UFFD_COMMON_H__#define __UFFD_COMMON_H__ -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <unistd.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 33/68 selftests/mount: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/mount/nosymfollow-test.c | 1 - tools/testing/selftests/mount/unprivileged-remount-test.c | 1 - 2 files changed, 2 deletions(-)
tools/testing/selftests/mount/nosymfollow-test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h>
tools/testing/selftests/mount/unprivileged-remount-test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <errno.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 34/68 selftests/mount_setattr: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/mount_setattr/mount_setattr_test.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/mount_setattr/mount_setattr_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <errno.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 35/68 selftests/move_mount_set_group: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- .../selftests/move_mount_set_group/move_mount_set_group_test.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <stdio.h> #include <errno.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 36/68 selftests/mqueue: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/mqueue/mq_perf_tests.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/mqueue/mq_perf_tests.c +0 -1
@@ -20,7 +20,6 @@* performance. * */ -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <unistd.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 37/68 selftests/net: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/net/af_unix/diag_uid.c | 2 -- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/scm_rights.c | 1 - tools/testing/selftests/net/af_unix/unix_connect.c | 2 -- tools/testing/selftests/net/csum.c | 3 --- tools/testing/selftests/net/gro.c | 3 --- tools/testing/selftests/net/ip_defrag.c | 3 --- tools/testing/selftests/net/ipsec.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel.c | 3 --- tools/testing/selftests/net/ipv6_flowlabel_mgr.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_inq.c | 3 --- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 3 --- tools/testing/selftests/net/msg_zerocopy.c | 3 --- tools/testing/selftests/net/netfilter/audit_logread.c | 2 -- tools/testing/selftests/net/netfilter/conntrack_dump_flush.c | 3 --- tools/testing/selftests/net/nettest.c | 2 -- tools/testing/selftests/net/psock_fanout.c | 3 --- tools/testing/selftests/net/psock_snd.c | 3 --- tools/testing/selftests/net/reuseport_addr_any.c | 3 --- tools/testing/selftests/net/reuseport_bpf_cpu.c | 3 --- tools/testing/selftests/net/reuseport_bpf_numa.c | 3 --- tools/testing/selftests/net/reuseport_dualstack.c | 3 --- tools/testing/selftests/net/so_incoming_cpu.c | 1 - tools/testing/selftests/net/so_netns_cookie.c | 1 - tools/testing/selftests/net/so_txtime.c | 3 --- tools/testing/selftests/net/tap.c | 3 --- tools/testing/selftests/net/tcp_fastopen_backup_key.c | 1 - tools/testing/selftests/net/tcp_inq.c | 2 -- tools/testing/selftests/net/tcp_mmap.c | 1 - tools/testing/selftests/net/tls.c | 3 --- tools/testing/selftests/net/toeplitz.c | 3 --- tools/testing/selftests/net/tun.c | 3 --- tools/testing/selftests/net/txring_overwrite.c | 3 --- tools/testing/selftests/net/txtimestamp.c | 3 --- tools/testing/selftests/net/udpgso.c | 3 --- tools/testing/selftests/net/udpgso_bench_rx.c | 3 --- tools/testing/selftests/net/udpgso_bench_tx.c | 3 --- 38 files changed, 97 deletions(-)
tools/testing/selftests/net/af_unix/diag_uid.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ - -#define _GNU_SOURCE#include <sched.h> #include <unistd.h>
tools/testing/selftests/net/af_unix/scm_pidfd.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 OR MIT -#define _GNU_SOURCE#include <error.h> #include <limits.h> #include <stddef.h>
tools/testing/selftests/net/af_unix/scm_rights.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ -#define _GNU_SOURCE#include <sched.h> #include <stdio.h>
tools/testing/selftests/net/af_unix/unix_connect.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <sched.h> #include <stddef.h>
tools/testing/selftests/net/csum.c +0 -3
@@ -58,9 +58,6 @@* different seed for each run (and logs this for reproducibility). It * is advised to enable this for extra coverage in continuous testing. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/byteorder.h> #include <errno.h>
tools/testing/selftests/net/gro.c +0 -3
@@ -34,9 +34,6 @@* flakiness is to be expected. * */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/ip_defrag.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/ipsec.c +0 -3
@@ -3,9 +3,6 @@* ipsec.c - Check xfrm on veth inside a net-ns. * Copyright (c) 2018 Dmitry Safonov */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/types.h> #include <errno.h>
tools/testing/selftests/net/ipv6_flowlabel.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO cmsg on send and recv */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/byteorder.h> #include <error.h>
tools/testing/selftests/net/ipv6_flowlabel_mgr.c +0 -3
@@ -1,8 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Test IPV6_FLOWINFO_MGR */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h>
tools/testing/selftests/net/mptcp/mptcp_connect.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <limits.h> #include <fcntl.h>
tools/testing/selftests/net/mptcp/mptcp_inq.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <assert.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/net/mptcp/mptcp_sockopt.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <assert.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/net/msg_zerocopy.c +0 -3
@@ -24,9 +24,6 @@* the kernel queues completions on the error queue for all zerocopy * transfers. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h>
tools/testing/selftests/net/netfilter/audit_logread.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <poll.h>
tools/testing/selftests/net/netfilter/conntrack_dump_flush.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <time.h> #include <libmnl/libmnl.h> #include <netinet/ip.h>
tools/testing/selftests/net/nettest.c +0 -2
@@ -3,8 +3,6 @@* * Copyright (c) 2013-2019 David Ahern <[email protected]>. All rights reserved. */ - -#define _GNU_SOURCE#include <features.h> #include <sys/types.h> #include <sys/ioctl.h>
tools/testing/selftests/net/psock_fanout.c +0 -3
@@ -26,9 +26,6 @@* Todo: * - functionality: PACKET_FANOUT_FLAG_DEFRAG */ - -#define _GNU_SOURCE/* for sched_setaffinity */ -#include <arpa/inet.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/net/psock_snd.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/reuseport_addr_any.c +0 -3
@@ -3,9 +3,6 @@/* Test that sockets listening on a specific address are preferred * over sockets listening on addr_any. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/reuseport_bpf_cpu.c +0 -3
@@ -11,9 +11,6 @@* This entire process is done for several different core id permutations * and for each IPv4/IPv6 and TCP/UDP combination. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/reuseport_bpf_numa.c +0 -3
@@ -3,9 +3,6 @@* Test functionality of BPF filters with SO_REUSEPORT. Same test as * in reuseport_bpf_cpu, only as one socket per NUMA node. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/reuseport_dualstack.c +0 -3
@@ -10,9 +10,6 @@* This test creates these mixed AF_INET/AF_INET6 sockets and asserts the * AF_INET preference for v4 packets. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/so_incoming_cpu.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright Amazon.com Inc. or its affiliates. */ -#define _GNU_SOURCE#include <sched.h> #include <fcntl.h>
tools/testing/selftests/net/so_netns_cookie.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <unistd.h> #include <stdio.h>
tools/testing/selftests/net/so_txtime.c +0 -3
@@ -9,9 +9,6 @@* the expected stream. Sender will read transmit timestamps from the error * queue. The streams can differ due to out-of-order delivery and drops. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h>
tools/testing/selftests/net/tap.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <stdio.h>
tools/testing/selftests/net/tcp_fastopen_backup_key.c +0 -1
@@ -12,7 +12,6 @@* there are no cases in which a cookie is not accepted by verifying * that TcpExtTCPFastOpenPassiveFail remains 0. */ -#define _GNU_SOURCE#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/tcp_inq.c +0 -2
@@ -5,8 +5,6 @@* * Simple example on how to use TCP_INQ and TCP_CM_INQ. */ -#define _GNU_SOURCE -#include <error.h> #include <netinet/in.h> #include <netinet/tcp.h>
tools/testing/selftests/net/tcp_mmap.c +0 -1
@@ -46,7 +46,6 @@* received 32768 MB (99.9939 % mmap'ed) in 7.43764 s, 36.9577 Gbit * cpu usage user:0.035 sys:3.467, 106.873 usec per MB, 65530 c-switches */ -#define _GNU_SOURCE#include <pthread.h> #include <sys/types.h> #include <fcntl.h>
tools/testing/selftests/net/tls.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/toeplitz.c +0 -3
@@ -20,9 +20,6 @@* 5. Compute the cpu that RPS should select based on rx_hash and $rps_bitmap * 6. Compare the cpus from 4 and 5 */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
tools/testing/selftests/net/tun.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <stdio.h>
tools/testing/selftests/net/txring_overwrite.c +0 -3
@@ -4,9 +4,6 @@* Verify that consecutive sends over packet tx_ring are mirrored * with their original content intact. */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <assert.h> #include <error.h>
tools/testing/selftests/net/txtimestamp.c +0 -3
@@ -16,9 +16,6 @@* This test requires a dummy TCP server. * A simple `nc6 [-u] -l -p $DESTPORT` will do */ - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <asm/types.h> #include <error.h>
tools/testing/selftests/net/udpgso.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <stddef.h> #include <arpa/inet.h> #include <error.h>
tools/testing/selftests/net/udpgso_bench_rx.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <error.h> #include <errno.h>
tools/testing/selftests/net/udpgso_bench_tx.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <arpa/inet.h> #include <errno.h> #include <error.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 38/68 selftests/net: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/tcp_ao/Makefile +1 -1
@@ -26,7 +26,7 @@ LIB := $(LIBDIR)/libaotst.a LDLIBS += $(LIB) -pthread LIBDEPS := lib/aolib.h Makefile -CFLAGS := -Wall -O2 -g -D_GNU_SOURCE -fno-strict-aliasing +CFLAGS := -Wall -O2 -g -fno-strict-aliasing CFLAGS += $(KHDR_INCLUDES) CFLAGS += -iquote ./lib/ -I ../../../../include/
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 39/68 selftests/nolibc: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/nolibc/nolibc-test.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/nolibc/nolibc-test.c +0 -2
@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#define _LARGEFILE64_SOURCE/* libc-specific include files
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 40/68 selftests/nsfs: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/nsfs/owner.c | 1 - tools/testing/selftests/nsfs/pidns.c | 1 - 2 files changed, 2 deletions(-)
tools/testing/selftests/nsfs/owner.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <unistd.h> #include <stdio.h>
tools/testing/selftests/nsfs/pidns.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <unistd.h> #include <stdio.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 41/68 selftests/openat2: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/openat2/helpers.c | 2 -- tools/testing/selftests/openat2/helpers.h | 1 - tools/testing/selftests/openat2/openat2_test.c | 2 -- tools/testing/selftests/openat2/rename_attack_test.c | 2 -- tools/testing/selftests/openat2/resolve_test.c | 2 -- 5 files changed, 9 deletions(-)
tools/testing/selftests/openat2/helpers.c +0 -2
@@ -3,8 +3,6 @@* Author: Aleksa Sarai <[email protected]> * Copyright (C) 2018-2019 SUSE LLC. */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <stdbool.h>
tools/testing/selftests/openat2/helpers.h +0 -1
@@ -7,7 +7,6 @@#ifndef __RESOLVEAT_H__#define __RESOLVEAT_H__ -#define _GNU_SOURCE#include <stdint.h> #include <stdbool.h> #include <errno.h>
tools/testing/selftests/openat2/openat2_test.c +0 -2
@@ -3,8 +3,6 @@* Author: Aleksa Sarai <[email protected]> * Copyright (C) 2018-2019 SUSE LLC. */ - -#define _GNU_SOURCE#include <fcntl.h> #include <sched.h> #include <sys/stat.h>
tools/testing/selftests/openat2/rename_attack_test.c +0 -2
@@ -3,8 +3,6 @@* Author: Aleksa Sarai <[email protected]> * Copyright (C) 2018-2019 SUSE LLC. */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
tools/testing/selftests/openat2/resolve_test.c +0 -2
@@ -3,8 +3,6 @@* Author: Aleksa Sarai <[email protected]> * Copyright (C) 2018-2019 SUSE LLC. */ - -#define _GNU_SOURCE#include <fcntl.h> #include <sched.h> #include <sys/stat.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 42/68 selftests/perf_events: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/perf_events/remove_on_exec.c | 2 -- tools/testing/selftests/perf_events/sigtrap_threads.c | 2 -- tools/testing/selftests/perf_events/watermark_signal.c | 2 -- 3 files changed, 6 deletions(-)
tools/testing/selftests/perf_events/remove_on_exec.c +0 -2
@@ -5,8 +5,6 @@* Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE -/* We need the latest siginfo from the kernel repo. */ #include <sys/types.h> #include <asm/siginfo.h>
tools/testing/selftests/perf_events/sigtrap_threads.c +0 -2
@@ -5,8 +5,6 @@* Copyright (C) 2021, Google LLC. */ -#define _GNU_SOURCE -/* We need the latest siginfo from the kernel repo. */ #include <sys/types.h> #include <asm/siginfo.h>
tools/testing/selftests/perf_events/watermark_signal.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <linux/perf_event.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 43/68 selftests/pid_namespace: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/pid_namespace/regression_enomem.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/pid_namespace/regression_enomem.c +0 -1
@@ -1,4 +1,3 @@ -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <fcntl.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 44/68 selftests/pidfd: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/pidfd/pidfd.h | 1 - tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_getfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_open_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_poll_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_setns_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_test.c | 2 -- tools/testing/selftests/pidfd/pidfd_wait.c | 2 -- 8 files changed, 15 deletions(-)
tools/testing/selftests/pidfd/pidfd.h +0 -1
@@ -3,7 +3,6 @@#ifndef __PIDFD_H#define __PIDFD_H -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <fcntl.h>
tools/testing/selftests/pidfd/pidfd_getfd_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h>
tools/testing/selftests/pidfd/pidfd_open_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <inttypes.h>
tools/testing/selftests/pidfd/pidfd_poll_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <linux/types.h> #include <poll.h>
tools/testing/selftests/pidfd/pidfd_setns_test.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h>
tools/testing/selftests/pidfd/pidfd_test.c +0 -2
@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/types.h>
tools/testing/selftests/pidfd/pidfd_wait.c +0 -2
@@ -1,6 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE#include <errno.h> #include <linux/sched.h> #include <linux/types.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 45/68 selftests/ptrace: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/ptrace/get_set_sud.c | 1 - tools/testing/selftests/ptrace/peeksiginfo.c | 1 - 2 files changed, 2 deletions(-)
tools/testing/selftests/ptrace/get_set_sud.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include "../kselftest_harness.h" #include <stdio.h> #include <string.h>
tools/testing/selftests/ptrace/peeksiginfo.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <signal.h> #include <unistd.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 46/68 selftests/powerpc: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/powerpc/benchmarks/context_switch.c | 2 -- tools/testing/selftests/powerpc/benchmarks/exec_target.c | 2 -- tools/testing/selftests/powerpc/benchmarks/fork.c | 2 -- tools/testing/selftests/powerpc/benchmarks/futex_bench.c | 3 --- tools/testing/selftests/powerpc/dexcr/hashchk_test.c | 3 --- tools/testing/selftests/powerpc/dscr/dscr_default_test.c | 3 --- tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c | 3 --- tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c | 1 - tools/testing/selftests/powerpc/mm/exec_prot.c | 2 -- tools/testing/selftests/powerpc/mm/pkey_exec_prot.c | 2 -- tools/testing/selftests/powerpc/mm/pkey_siginfo.c | 2 -- tools/testing/selftests/powerpc/mm/tlbie_test.c | 2 -- tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c | 1 - tools/testing/selftests/powerpc/pmu/count_instructions.c | 3 --- tools/testing/selftests/powerpc/pmu/count_stcx_fail.c | 3 --- tools/testing/selftests/powerpc/pmu/ebb/ebb.c | 3 --- .../testing/selftests/powerpc/pmu/ebb/instruction_count_test.c | 3 --- tools/testing/selftests/powerpc/pmu/event.c | 2 -- tools/testing/selftests/powerpc/pmu/lib.c | 3 --- tools/testing/selftests/powerpc/pmu/per_event_excludes.c | 3 --- tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c | 3 --- tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c | 2 -- tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c | 1 - tools/testing/selftests/powerpc/signal/sigreturn_kernel.c | 3 --- tools/testing/selftests/powerpc/signal/sigreturn_vdso.c | 3 --- tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c | 2 -- tools/testing/selftests/powerpc/tm/tm-exec.c | 2 -- tools/testing/selftests/powerpc/tm/tm-poison.c | 2 -- .../testing/selftests/powerpc/tm/tm-signal-context-force-tm.c | 2 -- tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c | 2 -- tools/testing/selftests/powerpc/tm/tm-tmspr.c | 2 -- tools/testing/selftests/powerpc/tm/tm-trap.c | 2 -- tools/testing/selftests/powerpc/tm/tm-unavailable.c | 2 -- tools/testing/selftests/powerpc/utils.c | 3 --- 34 files changed, 79 deletions(-)
tools/testing/selftests/powerpc/benchmarks/context_switch.c +0 -2
@@ -4,8 +4,6 @@* * Copyright (C) 2015 Anton Blanchard <[email protected]>, IBM */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <string.h>
tools/testing/selftests/powerpc/benchmarks/exec_target.c +0 -2
@@ -5,8 +5,6 @@* * Copyright 2018, Anton Blanchard, IBM Corp. */ - -#define _GNU_SOURCE#include <unistd.h> #include <sys/syscall.h>
tools/testing/selftests/powerpc/benchmarks/fork.c +0 -2
@@ -5,8 +5,6 @@* * Copyright 2018, Anton Blanchard, IBM Corp. */ - -#define _GNU_SOURCE#include <assert.h> #include <errno.h> #include <getopt.h>
tools/testing/selftests/powerpc/benchmarks/futex_bench.c +0 -3
@@ -2,9 +2,6 @@/* * Copyright 2016, Anton Blanchard, Michael Ellerman, IBM Corp. */ - -#define _GNU_SOURCE -#include <stdio.h> #include <sys/syscall.h> #include <time.h>
tools/testing/selftests/powerpc/dexcr/hashchk_test.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0+ - -#define _GNU_SOURCE -#include <errno.h> #include <fcntl.h> #include <limits.h>
tools/testing/selftests/powerpc/dscr/dscr_default_test.c +0 -3
@@ -9,9 +9,6 @@* Copyright 2012, Anton Blanchard, IBM Corporation. * Copyright 2015, Anshuman Khandual, IBM Corporation. */ - -#define _GNU_SOURCE -#include "dscr.h" #include <pthread.h>
tools/testing/selftests/powerpc/dscr/dscr_explicit_test.c +0 -3
@@ -15,9 +15,6 @@* Copyright 2012, Anton Blanchard, IBM Corporation. * Copyright 2015, Anshuman Khandual, IBM Corporation. */ - -#define _GNU_SOURCE -#include "dscr.h" #include "utils.h"
tools/testing/selftests/powerpc/dscr/dscr_sysfs_thread_test.c +0 -1
@@ -9,7 +9,6 @@* * Copyright 2015, Anshuman Khandual, IBM Corporation. */ -#define _GNU_SOURCE#include "dscr.h" static int test_thread_dscr (unsigned long val)
tools/testing/selftests/powerpc/mm/exec_prot.c +0 -2
@@ -6,8 +6,6 @@* * Test if applying execute protection on pages works as expected. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/powerpc/mm/pkey_exec_prot.c +0 -2
@@ -6,8 +6,6 @@* Test if applying execute protection on pages using memory * protection keys works as expected. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/powerpc/mm/pkey_siginfo.c +0 -2
@@ -8,8 +8,6 @@* attempted to be protected by two different keys from two competing * threads at the same time. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/powerpc/mm/tlbie_test.c +0 -2
@@ -14,8 +14,6 @@* and copy it back to the original area. This helps us to detect if any * store continued to happen after we marked the memory PROT_READ. */ - -#define _GNU_SOURCE#include <stdio.h> #include <sys/mman.h> #include <sys/types.h>
tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <stdlib.h>
tools/testing/selftests/powerpc/pmu/count_instructions.c +0 -3
@@ -2,9 +2,6 @@/* * Copyright 2013, Michael Ellerman, IBM Corp. */ - -#define _GNU_SOURCE -#include <stdio.h> #include <stdbool.h> #include <string.h>
tools/testing/selftests/powerpc/pmu/count_stcx_fail.c +0 -3
@@ -2,9 +2,6 @@* Copyright 2013, Michael Ellerman, IBM Corp. * Licensed under GPLv2. */ - -#define _GNU_SOURCE -#include <stdio.h> #include <stdbool.h> #include <string.h>
tools/testing/selftests/powerpc/pmu/ebb/ebb.c +0 -3
@@ -2,9 +2,6 @@/* * Copyright 2014, Michael Ellerman, IBM Corp. */ - -#define _GNU_SOURCE/* For CPU_ZERO etc. */ -#include <sched.h> #include <sys/wait.h> #include <setjmp.h>
tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c +0 -3
@@ -2,9 +2,6 @@/* * Copyright 2014, Michael Ellerman, IBM Corp. */ - -#define _GNU_SOURCE -#include <stdio.h> #include <stdbool.h> #include <string.h>
tools/testing/selftests/powerpc/pmu/event.c +0 -2
@@ -2,8 +2,6 @@/* * Copyright 2013, Michael Ellerman, IBM Corp. */ - -#define _GNU_SOURCE#include <unistd.h> #include <sys/syscall.h> #include <string.h>
tools/testing/selftests/powerpc/pmu/lib.c +0 -3
@@ -2,9 +2,6 @@/* * Copyright 2014, Michael Ellerman, IBM Corp. */ - -#define _GNU_SOURCE/* For CPU_ZERO etc. */ -#include <errno.h> #include <sched.h> #include <setjmp.h>
tools/testing/selftests/powerpc/pmu/per_event_excludes.c +0 -3
@@ -2,9 +2,6 @@/* * Copyright 2014, Michael Ellerman, IBM Corp. */ - -#define _GNU_SOURCE -#include <elf.h> #include <limits.h> #include <stdio.h>
tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c +0 -3
@@ -16,9 +16,6 @@* * Copyright (C) 2018 Michael Neuling, IBM Corporation. */ - -#define _GNU_SOURCE -#include <unistd.h> #include <assert.h> #include <sched.h>
tools/testing/selftests/powerpc/ptrace/ptrace-syscall.c +0 -2
@@ -8,8 +8,6 @@* test, and it was adapted to run on Powerpc by * Breno Leitao <[email protected]> */ -#define _GNU_SOURCE -#include <sys/ptrace.h> #include <sys/types.h> #include <sys/wait.h>
tools/testing/selftests/powerpc/signal/sig_sc_double_restart.c +0 -1
@@ -18,7 +18,6 @@* that sucker at the same time. Same for multiple signals of any kind * interrupting that sucker on 64bit... */ -#define _GNU_SOURCE#include <sys/types.h> #include <sys/wait.h> #include <sys/syscall.h>
tools/testing/selftests/powerpc/signal/sigreturn_kernel.c +0 -3
@@ -2,9 +2,6 @@/* * Test that we can't sigreturn to kernel addresses, or to kernel mode. */ - -#define _GNU_SOURCE -#include <stdio.h> #include <signal.h> #include <stdlib.h>
tools/testing/selftests/powerpc/signal/sigreturn_vdso.c +0 -3
@@ -5,9 +5,6 @@* * See handle_rt_signal64() and setup_trampoline() in signal_64.c */ - -#define _GNU_SOURCE -#include <errno.h> #include <stdio.h> #include <signal.h>
tools/testing/selftests/powerpc/syscalls/ipc_unmuxed.c +0 -2
@@ -5,8 +5,6 @@* This test simply tests that certain syscalls are implemented. It doesn't * actually exercise their logic in any way. */ - -#define _GNU_SOURCE#include <errno.h> #include <stdio.h> #include <unistd.h>
tools/testing/selftests/powerpc/tm/tm-exec.c +0 -2
@@ -8,8 +8,6 @@* It makes little sense for after an exec() call for the previously * suspended transaction to still exist. */ - -#define _GNU_SOURCE#include <errno.h> #include <inttypes.h> #include <libgen.h>
tools/testing/selftests/powerpc/tm/tm-poison.c +0 -2
@@ -11,8 +11,6 @@* present child's poison will leak into parent's f31 or vr31 registers, * otherwise, poison will never leak into parent's f31 and vr31 registers. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <unistd.h>
tools/testing/selftests/powerpc/tm/tm-signal-context-force-tm.c +0 -2
@@ -15,8 +15,6 @@* This test never fails (as returning EXIT_FAILURE). It either succeeds, * or crash the kernel (on a buggy kernel). */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <signal.h>
tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c +0 -2
@@ -8,8 +8,6 @@* It returns from the signal handler with the CPU at suspended state, but * without setting usercontext MSR Transaction State (TS) fields. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <signal.h>
tools/testing/selftests/powerpc/tm/tm-tmspr.c +0 -2
@@ -22,8 +22,6 @@* (b) abort transaction * (c) check TEXASR to see if FS has been corrupted */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <unistd.h>
tools/testing/selftests/powerpc/tm/tm-trap.c +0 -2
@@ -26,8 +26,6 @@* the endianness is verified on subsequent traps to determine if the * endianness "flipped back" to the native endianness (BE). */ - -#define _GNU_SOURCE#include <error.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/powerpc/tm/tm-unavailable.c +0 -2
@@ -13,8 +13,6 @@* corruption, but only for registers vs0 and vs32, which are respectively * representatives of FP and VEC/Altivec reg sets. */ - -#define _GNU_SOURCE#include <error.h> #include <stdio.h> #include <stdlib.h>
tools/testing/selftests/powerpc/utils.c +0 -3
@@ -2,9 +2,6 @@/* * Copyright 2013-2015, Michael Ellerman, IBM Corp. */ - -#define _GNU_SOURCE/* For CPU_ZERO etc. */ -#include <elf.h> #include <errno.h> #include <fcntl.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 47/68 selftests/proc: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/proc/proc-empty-vm.c | 3 --- 1 file changed, 3 deletions(-)
tools/testing/selftests/proc/proc-empty-vm.c +0 -3
@@ -23,9 +23,6 @@* /proc/${pid}/smaps * /proc/${pid}/smaps_rollup */ -#undef _GNU_SOURCE -#define _GNU_SOURCE -#undef NDEBUG#include <assert.h> #include <errno.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 48/68 selftests/proc: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/proc/Makefile | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/proc/Makefile +0 -1
@@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -D_GNU_SOURCE LDFLAGS += -pthread TEST_GEN_PROGS :=
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 49/68 selftests/ptp: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/ptp/testptp.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/ptp/testptp.c +0 -1
@@ -4,7 +4,6 @@* * Copyright (C) 2010 OMICRON electronics GmbH */ -#define _GNU_SOURCE#define __SANE_USERSPACE_TYPES__/* For PPC64, to get LL64 types */ #include <errno.h> #include <fcntl.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 50/68 selftests/resctrl: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/resctrl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/resctrl/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE +CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := resctrl_tests
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 51/68 selftests/riscv: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/riscv/hwprobe/cbo.c | 1 - tools/testing/selftests/riscv/hwprobe/which-cpus.c | 1 - 2 files changed, 2 deletions(-)
tools/testing/selftests/riscv/hwprobe/cbo.c +0 -1
@@ -5,7 +5,6 @@* Run with 'taskset -c <cpu-list> cbo' to only execute hwprobe on a * subset of cpus, as well as only executing the tests on those cpus. */ -#define _GNU_SOURCE#include <stdbool.h> #include <stdint.h> #include <string.h>
tools/testing/selftests/riscv/hwprobe/which-cpus.c +0 -1
@@ -5,7 +5,6 @@* Test the RISCV_HWPROBE_WHICH_CPUS flag of hwprobe. Also provides a command * line interface to get the cpu list for arbitrary hwprobe pairs. */ -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <string.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 52/68 selftests/riscv: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/riscv/mm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/riscv/mm/Makefile +1 -1
@@ -3,7 +3,7 @@ # Originally tools/testing/arm64/abi/Makefile # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += -std=gnu99 -I. TEST_GEN_FILES := mmap_default mmap_bottomup
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 53/68 selftests/rlimits: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/rlimits/rlimits-per-userns.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/rlimits/rlimits-per-userns.c +0 -1
@@ -2,7 +2,6 @@/* * Author: Alexey Gladkov <[email protected]> */ -#define _GNU_SOURCE#include <sys/types.h> #include <sys/wait.h> #include <sys/time.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 54/68 selftests/rseq: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- 4 files changed, 6 deletions(-)
tools/testing/selftests/rseq/basic_percpu_ops_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <pthread.h> #include <sched.h>
tools/testing/selftests/rseq/basic_test.c +0 -2
@@ -2,8 +2,6 @@/* * Basic test coverage for critical regions and rseq_current_cpu(). */ - -#define _GNU_SOURCE#include <assert.h> #include <sched.h> #include <signal.h>
tools/testing/selftests/rseq/param_test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <linux/membarrier.h> #include <pthread.h>
tools/testing/selftests/rseq/rseq.c +0 -2
@@ -14,8 +14,6 @@* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <stdio.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 55/68 selftests/safesetid: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/safesetid/safesetid-test.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/safesetid/safesetid-test.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <pwd.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 56/68 selftests/sched: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/sched/cs_prctl_test.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/sched/cs_prctl_test.c +0 -2
@@ -18,8 +18,6 @@* You should have received a copy of the GNU Lesser General Public License * along with this library; if not, see <http://www.gnu.org/licenses>. */ - -#define _GNU_SOURCE#include <sys/eventfd.h> #include <sys/wait.h> #include <sys/types.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 57/68 selftests/seccomp: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/seccomp/seccomp_benchmark.c | 1 - tools/testing/selftests/seccomp/seccomp_bpf.c | 2 -- 2 files changed, 3 deletions(-)
tools/testing/selftests/seccomp/seccomp_benchmark.c +0 -1
@@ -2,7 +2,6 @@* Strictly speaking, this is not a test. But it can report during test * runs so relative performace can be measured. */ -#define _GNU_SOURCE#include <assert.h> #include <err.h> #include <limits.h>
tools/testing/selftests/seccomp/seccomp_bpf.c +0 -2
@@ -4,8 +4,6 @@* * Test code for seccomp bpf. */ - -#define _GNU_SOURCE#include <sys/types.h> /*
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 58/68 selftests/sigaltstack: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/sigaltstack/sas.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/sigaltstack/sas.c +0 -2
@@ -6,8 +6,6 @@* If that succeeds, then swapcontext() can be used inside sighandler safely. * */ - -#define _GNU_SOURCE#include <signal.h> #include <stdio.h> #include <stdlib.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 59/68 selftests/splice: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/splice/default_file_splice_read.c | 1 - tools/testing/selftests/splice/splice_read.c | 1 - 2 files changed, 2 deletions(-)
tools/testing/selftests/splice/default_file_splice_read.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <fcntl.h> int main (int argc,char **argv)
tools/testing/selftests/splice/splice_read.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <limits.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 60/68 selftests/syscall_user_dispatch: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c | 2 -- tools/testing/selftests/syscall_user_dispatch/sud_test.c | 2 -- 2 files changed, 4 deletions(-)
tools/testing/selftests/syscall_user_dispatch/sud_benchmark.c +0 -2
@@ -4,8 +4,6 @@* * Benchmark and test syscall user dispatch */ - -#define _GNU_SOURCE#include <stdio.h> #include <string.h> #include <stdlib.h>
tools/testing/selftests/syscall_user_dispatch/sud_test.c +0 -2
@@ -4,8 +4,6 @@* * Test code for syscall user dispatch */ - -#define _GNU_SOURCE#include <sys/prctl.h> #include <sys/sysinfo.h> #include <sys/syscall.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 61/68 selftests/thermal: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- .../selftests/thermal/intel/power_floor/power_floor_test.c | 3 --- .../selftests/thermal/intel/workload_hint/workload_hint_test.c | 3 --- 2 files changed, 6 deletions(-)
tools/testing/selftests/thermal/intel/power_floor/power_floor_test.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <stdio.h> #include <string.h> #include <stdlib.h>
tools/testing/selftests/thermal/intel/workload_hint/workload_hint_test.c +0 -3
@@ -1,7 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE -#include <stdio.h> #include <string.h> #include <stdlib.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 62/68 selftests/timens: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/timens/clock_nanosleep.c | 1 - tools/testing/selftests/timens/exec.c | 1 - tools/testing/selftests/timens/futex.c | 1 - tools/testing/selftests/timens/gettime_perf.c | 1 - tools/testing/selftests/timens/procfs.c | 1 - tools/testing/selftests/timens/timens.c | 1 - tools/testing/selftests/timens/timer.c | 1 - tools/testing/selftests/timens/timerfd.c | 1 - tools/testing/selftests/timens/vfork_exec.c | 1 - 9 files changed, 9 deletions(-)
tools/testing/selftests/timens/clock_nanosleep.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <sys/timerfd.h>
tools/testing/selftests/timens/exec.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
tools/testing/selftests/timens/futex.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <linux/unistd.h>
tools/testing/selftests/timens/gettime_perf.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sys/types.h> #include <sys/stat.h> #include <errno.h>
tools/testing/selftests/timens/procfs.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <math.h>
tools/testing/selftests/timens/timens.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
tools/testing/selftests/timens/timer.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <sys/syscall.h>
tools/testing/selftests/timens/timerfd.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <sched.h> #include <sys/timerfd.h>
tools/testing/selftests/timens/vfork_exec.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <sched.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 63/68 selftests/tmpfs: Drop duplicate -D_GNU_SOURCE
In reply to Edward Liaw-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
--- tools/testing/selftests/tmpfs/Makefile | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/tmpfs/Makefile +0 -1
@@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -CFLAGS += -D_GNU_SOURCE TEST_GEN_PROGS := TEST_GEN_PROGS += bug-link-o-tmpfile
--
2.45.0.118.g7fe29c98d7-goog
PATCH v3 64/68 selftests/uevent: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/uevent/uevent_filtering.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/uevent/uevent_filtering.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/netlink.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 65/68 selftests/user_events: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/user_events/abi_test.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/user_events/abi_test.c +0 -2
@@ -4,8 +4,6 @@* * Copyright (c) 2022 Beau Belgrave <[email protected]> */ - -#define _GNU_SOURCE#include <sched.h> #include <errno.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 66/68 selftests/vDSO: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/vDSO/vdso_test_abi.c | 1 - tools/testing/selftests/vDSO/vdso_test_clock_getres.c | 2 -- tools/testing/selftests/vDSO/vdso_test_correctness.c | 3 --- 3 files changed, 6 deletions(-)
tools/testing/selftests/vDSO/vdso_test_abi.c +0 -1
@@ -14,7 +14,6 @@#include <time.h> #include <sys/auxv.h> #include <sys/time.h> -#define _GNU_SOURCE#include <unistd.h> #include <sys/syscall.h>
tools/testing/selftests/vDSO/vdso_test_clock_getres.c +0 -2
@@ -10,8 +10,6 @@* Power (32-bit and 64-bit), S390x (32-bit and 64-bit). * Might work on other architectures. */ - -#define _GNU_SOURCE#include <elf.h> #include <err.h> #include <fcntl.h>
tools/testing/selftests/vDSO/vdso_test_correctness.c +0 -3
@@ -3,9 +3,6 @@* ldt_gdt.c - Test cases for LDT and GDT access * Copyright (c) 2011-2015 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdio.h> #include <sys/time.h> #include <time.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 67/68 selftests/wireguard: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
--- tools/testing/selftests/wireguard/qemu/init.c | 2 -- 1 file changed, 2 deletions(-)
tools/testing/selftests/wireguard/qemu/init.c +0 -2
@@ -2,8 +2,6 @@/* * Copyright (C) 2015-2019 Jason A. Donenfeld <[email protected]>. All Rights Reserved. */ - -#define _GNU_SOURCE#include <unistd.h> #include <errno.h> #include <string.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
PATCH v3 68/68 selftests/x86: Drop define _GNU_SOURCE
In reply to Edward Liaw_GNU_SOURCE is provided by lib.mk, so it should be dropped to prevent redefinition warnings.
Drop #define __USE_GNU too, as it is bad practice and the GNU extensions aren't actually being used in test_FCMOV, etc. where it is being defined.
--- tools/testing/selftests/x86/amx.c | 2 -- tools/testing/selftests/x86/check_initial_reg_state.c | 3 --- tools/testing/selftests/x86/corrupt_xstate_header.c | 3 --- tools/testing/selftests/x86/entry_from_vm86.c | 3 --- tools/testing/selftests/x86/fsgsbase.c | 2 -- tools/testing/selftests/x86/fsgsbase_restore.c | 2 -- tools/testing/selftests/x86/ioperm.c | 2 -- tools/testing/selftests/x86/iopl.c | 2 -- tools/testing/selftests/x86/lam.c | 1 - tools/testing/selftests/x86/ldt_gdt.c | 2 -- tools/testing/selftests/x86/mov_ss_trap.c | 2 -- tools/testing/selftests/x86/nx_stack.c | 2 -- tools/testing/selftests/x86/ptrace_syscall.c | 2 -- tools/testing/selftests/x86/sigaltstack.c | 2 -- tools/testing/selftests/x86/sigreturn.c | 3 --- tools/testing/selftests/x86/single_step_syscall.c | 3 --- tools/testing/selftests/x86/syscall_arg_fault.c | 3 --- tools/testing/selftests/x86/syscall_numbering.c | 3 --- tools/testing/selftests/x86/sysret_rip.c | 3 --- tools/testing/selftests/x86/sysret_ss_attrs.c | 3 --- tools/testing/selftests/x86/test_FCMOV.c | 4 ---- tools/testing/selftests/x86/test_FCOMI.c | 4 ---- tools/testing/selftests/x86/test_FISTTP.c | 4 ---- tools/testing/selftests/x86/test_mremap_vdso.c | 1 - tools/testing/selftests/x86/test_shadow_stack.c | 3 --- tools/testing/selftests/x86/test_syscall_vdso.c | 4 ---- tools/testing/selftests/x86/test_vsyscall.c | 3 --- tools/testing/selftests/x86/unwind_vdso.c | 3 --- tools/testing/selftests/x86/vdso_restorer.c | 3 --- 29 files changed, 77 deletions(-)
tools/testing/selftests/x86/amx.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 - -#define _GNU_SOURCE#include <err.h> #include <errno.h> #include <pthread.h>
tools/testing/selftests/x86/check_initial_reg_state.c +0 -3
@@ -3,9 +3,6 @@* check_initial_reg_state.c - check that execve sets the correct state * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdio.h> unsigned long ax, bx, cx, dx, si, di, bp, sp, flags;
tools/testing/selftests/x86/corrupt_xstate_header.c +0 -3
@@ -4,9 +4,6 @@* * Based on analysis and a test case from Thomas Gleixner. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <string.h>
tools/testing/selftests/x86/entry_from_vm86.c +0 -3
@@ -5,9 +5,6 @@* * This exercises a few paths that need to special-case vm86 mode. */ - -#define _GNU_SOURCE -#include <assert.h> #include <stdlib.h> #include <sys/syscall.h>
tools/testing/selftests/x86/fsgsbase.c +0 -2
@@ -3,8 +3,6 @@* fsgsbase.c, an fsgsbase test * Copyright (c) 2014-2016 Andy Lutomirski */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdbool.h>
tools/testing/selftests/x86/fsgsbase_restore.c +0 -2
@@ -12,8 +12,6 @@* * This is not part of fsgsbase.c, because that test is 64-bit only. */ - -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <stdbool.h>
tools/testing/selftests/x86/ioperm.c +0 -2
@@ -3,8 +3,6 @@* ioperm.c - Test case for ioperm(2) * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h>
tools/testing/selftests/x86/iopl.c +0 -2
@@ -3,8 +3,6 @@* iopl.c - Test case for a Linux on Xen 64-bit bug * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h>
tools/testing/selftests/x86/lam.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE#include <stdio.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/ldt_gdt.c +0 -2
@@ -3,8 +3,6 @@* ldt_gdt.c - Test cases for LDT and GDT access * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE#include <err.h> #include <stdio.h> #include <stdint.h>
tools/testing/selftests/x86/mov_ss_trap.c +0 -2
@@ -19,8 +19,6 @@* * This should mostly cover CVE-2018-1087 and CVE-2018-8897. */ -#define _GNU_SOURCE -#include <stdlib.h> #include <sys/ptrace.h> #include <sys/types.h>
tools/testing/selftests/x86/nx_stack.c +0 -2
@@ -23,8 +23,6 @@* Regular stack is completely overwritten before testing. * Test doesn't exit SIGSEGV handler after first fault at INT3. */ -#undef _GNU_SOURCE -#define _GNU_SOURCE#undef NDEBUG#include <assert.h> #include <signal.h>
tools/testing/selftests/x86/ptrace_syscall.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define _GNU_SOURCE -#include <sys/ptrace.h> #include <sys/types.h> #include <sys/wait.h>
tools/testing/selftests/x86/sigaltstack.c +0 -2
@@ -1,6 +1,4 @@// SPDX-License-Identifier: GPL-2.0-only - -#define _GNU_SOURCE#include <signal.h> #include <stdio.h> #include <stdbool.h>
tools/testing/selftests/x86/sigreturn.c +0 -3
@@ -24,9 +24,6 @@* * Do not run on outdated, unpatched kernels at risk of nasty crashes. */ - -#define _GNU_SOURCE -#include <sys/time.h> #include <time.h> #include <stdlib.h>
tools/testing/selftests/x86/single_step_syscall.c +0 -3
@@ -9,9 +9,6 @@* immediately issues #DB from CPL 0. This requires special handling in * the kernel. */ - -#define _GNU_SOURCE -#include <sys/time.h> #include <time.h> #include <stdlib.h>
tools/testing/selftests/x86/syscall_arg_fault.c +0 -3
@@ -3,9 +3,6 @@* syscall_arg_fault.c - tests faults 32-bit fast syscall stack args * Copyright (c) 2015 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <string.h>
tools/testing/selftests/x86/syscall_numbering.c +0 -3
@@ -5,9 +5,6 @@* * Copyright (c) 2018 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <stdio.h> #include <stdbool.h>
tools/testing/selftests/x86/sysret_rip.c +0 -3
@@ -3,9 +3,6 @@* sigreturn.c - tests that x86 avoids Intel SYSRET pitfalls * Copyright (c) 2014-2016 Andrew Lutomirski */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <unistd.h> #include <stdio.h>
tools/testing/selftests/x86/sysret_ss_attrs.c +0 -3
@@ -7,9 +7,6 @@* the hidden attributes set to an unusable state. Make sure the kernel * doesn't let this happen. */ - -#define _GNU_SOURCE -#include <stdlib.h> #include <unistd.h> #include <stdio.h>
tools/testing/selftests/x86/test_FCMOV.c +0 -4
@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/test_FCOMI.c +0 -4
@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/test_FISTTP.c +0 -4
@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/test_mremap_vdso.c +0 -1
@@ -9,7 +9,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_mremap_vdso.c */ -#define _GNU_SOURCE#include <stdio.h> #include <errno.h> #include <unistd.h>
tools/testing/selftests/x86/test_shadow_stack.c +0 -3
@@ -7,9 +7,6 @@* special glibc shadow stack support (longjmp(), swapcontext(), etc). Just * stick to the basics and hope the compiler doesn't do anything strange. */ - -#define _GNU_SOURCE -#include <sys/syscall.h> #include <asm/mman.h> #include <sys/mman.h>
tools/testing/selftests/x86/test_syscall_vdso.c +0 -4
@@ -8,10 +8,6 @@* Can be built statically: * gcc -Os -Wall -static -m32 test_syscall_vdso.c thunks_32.S */ -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#undef __USE_GNU -#define __USE_GNU 1#include <unistd.h> #include <stdlib.h> #include <string.h>
tools/testing/selftests/x86/test_vsyscall.c +0 -3
@@ -1,7 +1,4 @@/* SPDX-License-Identifier: GPL-2.0 */ - -#define _GNU_SOURCE -#include <stdio.h> #include <sys/time.h> #include <time.h>
tools/testing/selftests/x86/unwind_vdso.c +0 -3
@@ -5,9 +5,6 @@* * This tests __kernel_vsyscall's unwind info. */ - -#define _GNU_SOURCE -#include <features.h> #include <stdio.h>
tools/testing/selftests/x86/vdso_restorer.c +0 -3
@@ -10,9 +10,6 @@* 64-bit userspace has never supported sa_restorer == NULL, so this is * 32-bit only. */ - -#define _GNU_SOURCE -#include <err.h> #include <stdio.h> #include <dlfcn.h>
Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
Mathieu Desnoyers
maintainerRe: [PATCH v3 54/68] selftests/rseq: Drop define _GNU_SOURCE
In reply to Edward LiawQuoted 4 lines · Edward Liaw
_GNU_SOURCEis provided by lib.mk, so it should be dropped to prevent redefinition warnings.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")
The patch per se looks fine, except for the "Fixes" tag.
Commit 809216233555 introduces use of asprintf in kselftest_harness.h which is used by (all ?) selftests, including the rseq ones. However, the rseq selftests each have the #define _GNU_SOURCE, which would have been OK without those further changes.
So this patch is more about consolidating where the _GNU_SOURCE is defined, which is OK with me, but not so much about "fixing" an issue with commit 809216233555.
A "Fix" is something to be backported to stable kernels, and I don't think this patch reaches that threshold.
If anything, this patch removes a warning that gets added by
https://lore.kernel.org/lkml/[email protected]/T/#mf8438d03de6e2b613da4f86d4f60c5fe1c5f8483
within the same series.
Arguably, each #define _GNU_SOURCE could have been first protected by a #ifndef guard to eliminate this transient warning, and there would be nothing to "fix" in this consolidation series.
Thoughts ?
Thanks,
Mathieu
Quoted 56 lines
Reviewed-by John Hubbard <[email protected]>Reviewed-by Muhammad Usama Anjum <[email protected]>Signed-off-by Edward Liaw <[email protected]>--- tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- 4 files changed, 6 deletions(-)tools/testing/selftests/rseq/basic_percpu_ops_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <pthread.h> #include <sched.h> tools/testing/selftests/rseq/basic_test.c +0
-2@@ -2,8 +2,6 @@/* * Basic test coverage for critical regions and rseq_current_cpu(). */ - -#define _GNU_SOURCE#include <assert.h> #include <sched.h> #include <signal.h> tools/testing/selftests/rseq/param_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <linux/membarrier.h> #include <pthread.h> tools/testing/selftests/rseq/rseq.c +0
-2@@ -14,8 +14,6 @@* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <stdio.h>
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com
Re: [PATCH v3 13/68] selftests/damon: Drop define _GNU_SOURCE
In reply to Edward LiawHi Edward,
Quoted 4 lines · On Thu, 9 May 2024 19:58:05 +0000 Edward Liaw <[email protected]> wrote:
_GNU_SOURCEis provided by lib.mk, so it should be dropped to prevent redefinition warnings.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")
I show Mathieu's comment on this[1]. I have no strong opinion on this, but if you conclude to remove or change this line, please apply same change to this patch.
[1] https://lore.kernel.org/[email protected]
Quoted 1 line
Signed-off-by Edward Liaw <[email protected]>
I also added trivial comments that coming from my personal and humble preferrence below. Other than the above and the below comments,
Quoted 10 lines
--- tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c | 3 --- .../damon/debugfs_target_ids_read_before_terminate_race.c | 2 -- 2 files changed, 5 deletions(-)tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c +0
-0
tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c line 5
Quoted 7 lines
tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c +0
-3@@ -2,9 +2,6 @@/* * Author: SeongJae Park <[email protected]> */ - -#define _GNU_SOURCE -#include <fcntl.h>
I'd prefer having one empty line between the comment and includes.
tools/testing/selftests/damon/debugfs_target_ids_read_before_terminate_race.c line 5
Quoted 13 lines
tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c +0
-0#include <stdbool.h> #include <stdint.h> tools/testing/selftests/damon/debugfs_target_ids_read_before_terminate_race.c +0
-2@@ -2,8 +2,6 @@/* * Author: SeongJae Park <[email protected]> */ -#define _GNU_SOURCE -#include <fcntl.h>
Ditto.
And I realize I also forgot adding one empty line before the above #define line. That's why I'm saying this is just a trivial comment :)
Quoted 4 lines
tools/testing/selftests/damon/debugfs_target_ids_read_before_terminate_race.c +0
-0#include <stdbool.h> #include <stdint.h> Signature · 1 line
2.45.0.118.g7fe29c98d7-goog
Thanks,
SJ
Re: [PATCH v3 54/68] selftests/rseq: Drop define _GNU_SOURCE
In reply to Mathieu DesnoyersQuoted 21 lines · Mathieu Desnoyers
Quoted 4 lines · Edward Liaw
_GNU_SOURCEis provided by lib.mk, so it should be dropped to prevent redefinition warnings.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")The patch per se looks fine, except for the "Fixes" tag.
Commit 809216233555 introduces use of asprintf in
kselftest_harness.hwhich is used by (all ?) selftests, including the rseq ones. However, the rseq selftests each have the #define_GNU_SOURCE, which would have been OK without those further changes.So this patch is more about consolidating where the
_GNU_SOURCEis defined, which is OK with me, but not so much about "fixing" an issue with commit 809216233555.A "Fix" is something to be backported to stable kernels, and I don't think this patch reaches that threshold.
Quoted 7 lines
If anything, this patch removes a warning that gets added by
https://lore.kernel.org/lkml/[email protected]/T/#mf8438d03de6e2b613da4f86d4f60c5fe1c5f8483
within the same series.Arguably, each #define
_GNU_SOURCEcould have been first protected by a #ifndef guard to eliminate this transient warning, and there would be nothing to "fix" in this consolidation series.
That makes sense. I can remove the fixes tags. 809216233555 will likely be reverted first anyway, and you're right that the focus of this patch series is on consolidating _GNU_SOURCE.
Quoted 69 lines
Thoughts ?
Thanks,
Mathieu
Quoted 48 lines
Reviewed-by John Hubbard <[email protected]>Reviewed-by Muhammad Usama Anjum <[email protected]>Signed-off-by Edward Liaw <[email protected]>--- tools/testing/selftests/rseq/basic_percpu_ops_test.c | 1 - tools/testing/selftests/rseq/basic_test.c | 2 -- tools/testing/selftests/rseq/param_test.c | 1 - tools/testing/selftests/rseq/rseq.c | 2 -- 4 files changed, 6 deletions(-)tools/testing/selftests/rseq/basic_percpu_ops_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <pthread.h> #include <sched.h> tools/testing/selftests/rseq/basic_test.c +0
-2@@ -2,8 +2,6 @@/* * Basic test coverage for critical regions and rseq_current_cpu(). */ - -#define _GNU_SOURCE#include <assert.h> #include <sched.h> #include <signal.h> tools/testing/selftests/rseq/param_test.c +0
-1@@ -1,5 +1,4 @@// SPDX-License-Identifier: LGPL-2.1 -#define _GNU_SOURCE#include <assert.h> #include <linux/membarrier.h> #include <pthread.h> tools/testing/selftests/rseq/rseq.c +0
-0tools/testing/selftests/rseq/rseq.c line 19
Quoted 8 lines
tools/testing/selftests/rseq/rseq.c +0
-2@@ -14,8 +14,6 @@* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - -#define _GNU_SOURCE#include <errno.h> #include <sched.h> #include <stdio.h> --
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
Re: [PATCH v3 13/68] selftests/damon: Drop define _GNU_SOURCE
In reply to SeongJae ParkQuoted 5 lines · SeongJae Park
Hi Edward,
On Thu, 9 May 2024 19:58:05 +0000 Edward Liaw <[email protected]> wrote:
Quoted 8 lines
Quoted 4 lines
_GNU_SOURCEis provided by lib.mk, so it should be dropped to prevent redefinition warnings.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")I show Mathieu's comment on this[1]. I have no strong opinion on this, but if you conclude to remove or change this line, please apply same change to this patch.
Will do, thanks for reviewing.
Quoted 46 lines
[1] https://lore.kernel.org/[email protected]
Quoted 1 line
Signed-off-by Edward Liaw <[email protected]>I also added trivial comments that coming from my personal and humble preferrence below. Other than the above and the below comments,
Reviewed-by SeongJae Park <[email protected]>Quoted 10 lines
--- tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c | 3 --- .../damon/debugfs_target_ids_read_before_terminate_race.c | 2 -- 2 files changed, 5 deletions(-)tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c +0
-0tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c line 5
Quoted 7 lines
tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c +0
-3@@ -2,9 +2,6 @@/* * Author: SeongJae Park <[email protected]> */ - -#define _GNU_SOURCE -#include <fcntl.h> I'd prefer having one empty line between the comment and includes.
tools/testing/selftests/damon/debugfs_target_ids_read_before_terminate_race.c line 5
Quoted 13 lines
tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c +0
-0#include <stdbool.h> #include <stdint.h> tools/testing/selftests/damon/debugfs_target_ids_read_before_terminate_race.c +0
-2@@ -2,8 +2,6 @@/* * Author: SeongJae Park <[email protected]> */ -#define _GNU_SOURCE -#include <fcntl.h> Ditto.
Quoted 2 lines
And I realize I also forgot adding one empty line before the above #define line. That's why I'm saying this is just a trivial comment :)
No problem, I will add it back in.
Thanks,
Edward
Quoted 9 lines
Quoted 5 lines
tools/testing/selftests/damon/debugfs_target_ids_read_before_terminate_race.c +0
-1#include <stdbool.h> #include <stdint.h> --2.45.0.118.g7fe29c98d7-goog
Thanks,
SJ
John Hubbard
reviewerRe: [PATCH v3 03/68] selftests: Compile with -D_GNU_SOURCE when including lib.mk
In reply to Edward LiawQuoted 11 lines · Edward Liaw
lib.mk will add -D_GNU_SOURCE to CFLAGS by default. This will make it unnecessary to add #define
_GNU_SOURCEin the source code.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Suggested-by John Hubbard <[email protected]>Signed-off-by Edward Liaw <[email protected]>--- tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/lib.mk | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-)
Hi Edward,
This looks good, with one small refactoring opportunity remaining, though:
Quoted 5 lines
tools/testing/selftests/Makefile +0
-0
tools/testing/selftests/Makefile ifneq ($(KBUILD_OUTPUT),) · line 177
Quoted 10 lines
tools/testing/selftests/Makefile +2
-2@@ -170,11 +170,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include else BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include
As mentioned in [1] (but there are a lot of patches to manage here, and I think it got overlooked), you could factor out the duplicated -D_GNU_SOURCE items into a single place:
[1] https://lore.kernel.org/all/[email protected]/
thanks,
Signature · 2 lines
John Hubbard NVIDIA
Quoted 26 lines
tools/testing/selftests/Makefile +0
-0DEFAULT_INSTALL_HDR_PATH := 1 endiftools/testing/selftests/lib.mk +4
-1@@ -67,7 +67,7 @@ MAKEFLAGS += --no-print-directory endif ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include endif # In order to use newer items that haven't yet been added to the user's system@@ -188,6 +188,9 @@ endef clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) $(CLEAN) +# Build with _GNU_SOURCE by default +CFLAGS += -D_GNU_SOURCE + # Enables to extend CFLAGS and LDFLAGS from command line, e.g. # make USERCFLAGS=-Werror USERLDFLAGS=-static CFLAGS += $(USERCFLAGS)
Re: [PATCH v3 50/68] selftests/resctrl: Drop duplicate -D_GNU_SOURCE
In reply to Edward LiawHi Edward,
Quoted 6 lines · Edward Liaw
-D_GNU_SOURCE can be de-duplicated here, as it is added by lib.mk.
Reviewed-by John Hubbard <[email protected]>Reviewed-by Muhammad Usama Anjum <[email protected]>Signed-off-by Edward Liaw <[email protected]>---
Thank you very much.
Reinette
Re: [PATCH v3 03/68] selftests: Compile with -D_GNU_SOURCE when including lib.mk
In reply to John HubbardQuoted 29 lines · John Hubbard
Quoted 11 lines · Edward Liaw
lib.mk will add -D_GNU_SOURCE to CFLAGS by default. This will make it unnecessary to add #define
_GNU_SOURCEin the source code.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Suggested-by John Hubbard <[email protected]>Signed-off-by Edward Liaw <[email protected]>--- tools/testing/selftests/Makefile | 4 ++-- tools/testing/selftests/lib.mk | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-)Hi Edward,
This looks good, with one small refactoring opportunity remaining, though:
Quoted 11 lines
tools/testing/selftests/Makefile +1
-1@@ -170,11 +170,11 @@ ifneq ($(KBUILD_OUTPUT),) # $(realpath ...) resolves symlinks abs_objtree := $(realpath $(abs_objtree)) BUILD := $(abs_objtree)/kselftest - KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_objtree}/usr/include + KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include else
Quoted 8 lines
tools/testing/selftests/Makefile ifneq ($(KBUILD_OUTPUT),) · line 177
Quoted 4 lines
tools/testing/selftests/Makefile +1
-1BUILD := $(CURDIR) abs_srctree := $(shell cd $(top_srcdir) && pwd) - KHDR_INCLUDES := -D_GNU_SOURCE -isystem ${abs_srctree}/usr/include + KHDR_INCLUDES := -isystem ${abs_srctree}/usr/includeAs mentioned in [1] (but there are a lot of patches to manage here, and I think it got overlooked), you could factor out the duplicated -D_GNU_SOURCE items into a single place:
Hi John,
Here I'm reverting the change I made to the Makefile in patch 1/68, since -D_GNU_SOURCE is being added directly to CFLAGS now, I didn't think it was necessary to add it to KHDR_INCLUDES anymore. I would have merged the two patches together, but since the first and second patches from v2 were already merged, I thought I should leave them in the series.
Thanks,
Edward
Quoted 37 lines
[1]
https://lore.kernel.org/all/[email protected]/thanks,
--
John Hubbard
NVIDIAQuoted 26 lines
tools/testing/selftests/Makefile +0
-0DEFAULT_INSTALL_HDR_PATH := 1 endiftools/testing/selftests/lib.mk +4
-1@@ -67,7 +67,7 @@ MAKEFLAGS += --no-print-directory endif ifeq ($(KHDR_INCLUDES),) -KHDR_INCLUDES := -D_GNU_SOURCE -isystem $(top_srcdir)/usr/include +KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include endif # In order to use newer items that haven't yet been added to the user's system@@ -188,6 +188,9 @@ endef clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) $(CLEAN) +# Build with _GNU_SOURCE by default +CFLAGS += -D_GNU_SOURCE + # Enables to extend CFLAGS and LDFLAGS from command line, e.g. # make USERCFLAGS=-Werror USERLDFLAGS=-static CFLAGS += $(USERCFLAGS)
Re: [PATCH v3 27/68] selftests/landlock: Drop define _GNU_SOURCE
In reply to Edward LiawQuoted 7 lines · Edward Liaw
_GNU_SOURCEis provided by lib.mk, so it should be dropped to prevent redefinition warnings.Fixes 809216233555 ("selftests/harness: remove use of LINE_MAX")Reviewed-by John Hubbard <[email protected]>Reviewed-by Muhammad Usama Anjum <[email protected]>Signed-off-by Edward Liaw <[email protected]>
Please only remove lines with _GNU_SOURCE, not the empty lines. I think it would be better to not change such style choice for other subsystems too.
With this change for the Landlock selftests:
Quoted 63 lines
--- tools/testing/selftests/landlock/base_test.c | 2 -- tools/testing/selftests/landlock/fs_test.c | 2 -- tools/testing/selftests/landlock/net_test.c | 2 -- tools/testing/selftests/landlock/ptrace_test.c | 2 -- 4 files changed, 8 deletions(-)tools/testing/selftests/landlock/base_test.c +0
-2@@ -5,8 +5,6 @@* Copyright © 2017-2020 Mickaël Salaün <[email protected]> * Copyright © 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h> tools/testing/selftests/landlock/fs_test.c +0
-2@@ -6,8 +6,6 @@* Copyright © 2020 ANSSI * Copyright © 2020-2022 Microsoft Corporation */ - -#define _GNU_SOURCE#include <asm/termbits.h> #include <fcntl.h> #include <libgen.h> tools/testing/selftests/landlock/net_test.c +0
-2@@ -5,8 +5,6 @@* Copyright © 2022-2023 Huawei Tech. Co., Ltd. * Copyright © 2023 Microsoft Corporation */ - -#define _GNU_SOURCE#include <arpa/inet.h> #include <errno.h> #include <fcntl.h> tools/testing/selftests/landlock/ptrace_test.c +0
-2@@ -5,8 +5,6 @@* Copyright © 2017-2020 Mickaël Salaün <[email protected]> * Copyright © 2019-2020 ANSSI */ - -#define _GNU_SOURCE#include <errno.h> #include <fcntl.h> #include <linux/landlock.h> Signature · 1 line
2.45.0.118.g7fe29c98d7-goog