linux/tools
Wake Liu f44ce7fdbd selftests: timers: Partially revert "Remove local NSEC_PER_SEC and USEC_PER_SEC defines"
This partially reverts commit 80fa614e2f ("selftests: timers: Remove
local NSEC_PER_SEC and USEC_PER_SEC defines").

The original commit removed local definitions of NSEC_PER_SEC and
USEC_PER_SEC in favor of including <include/vdso/time64.h>. However,
NSEC_PER_SEC in vdso/time64.h is defined as 1000000000L, which is
32-bit on 32-bit architectures. This causes integer overflow warnings
in several timer tests when doing arithmetic like NSEC_PER_SEC * 10 on
32-bit systems.

To fix this, restore the local definitions of NSEC_PER_SEC and
USEC_PER_SEC in the test files, but use "LL" suffix consistently
(1000000000LL and 1000000LL) to ensure 64-bit arithmetic and avoid
overflows.

We keep the cleanup from the original commit that renamed plural
definitions (NSECS_PER_SEC/USECS_PER_SEC) to singular ones in
posix_timers.c, but we now define them locally there as well.
This also removes the dependency of the selftests on the internal
kernel header <include/vdso/time64.h>.

Signed-off-by: Wake Liu <wakel@google.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: John Stultz <jstultz@google.com>
Link: https://patch.msgid.link/20260610014721.718362-1-wakel@google.com
2026-07-10 09:20:55 +02:00
..
accounting tools/accounting/getdelays: fix -Wformat-truncation warning in format_timespec 2026-05-28 21:24:40 -07:00
arch perf tools changes for v7.2: 2026-06-23 11:34:49 -07:00
bootconfig Bootconfig updates for v7.2 2026-06-16 17:29:24 +05:30
bpf bpftool: Fix vmlinux BTF leak in cgroup commands 2026-06-21 18:02:10 -07:00
build perf tools changes for v7.2: 2026-06-23 11:34:49 -07:00
certs
cgroup
counter
crypto
debugging
dma
docs
firewire
firmware
gpio
hv tools: hv: Fix cross-compilation 2026-04-14 04:43:26 +00:00
iio iio: core: Add IIO_COVERAGE channel type 2026-05-31 11:01:50 +01:00
include Merge tag 'bpf-next-7.2' into loongarch-next 2026-06-22 11:29:06 +08:00
kvm/kvm_stat
laptop
leds
lib A handful of late-arriving docs fixes, along with one document update 2026-06-25 09:09:38 -07:00
memory-model
mm slab changes for 7.2 - part 2 2026-06-22 08:28:48 -07:00
net tools/ynl: add missing uapi header deps in Makefile.deps 2026-06-24 19:30:55 -07:00
objtool objtool/klp: Cache dont_correlate() result 2026-05-04 21:16:07 -07:00
pcmcia
perf perf tools changes for v7.2: 2026-06-23 11:34:49 -07:00
power platform-drivers-x86 for v7.2-1 2026-06-23 08:31:33 -07:00
rcu
sched
sched_ext sched_ext: Move sources under kernel/sched/ext/ 2026-06-22 05:32:56 -10:00
scripts Kbuild/Kconfig updates for 7.1 2026-04-14 09:18:40 -07:00
sound
spi
testing selftests: timers: Partially revert "Remove local NSEC_PER_SEC and USEC_PER_SEC defines" 2026-07-10 09:20:55 +02:00
thermal
time
tracing rtla/tests: Fix pgrep filter in get_workload_pids.sh 2026-06-17 16:26:44 +02:00
unittests docs: kernel-doc: python: strip __counted_by_ptr macro 2026-05-15 08:11:36 -06:00
usb usbip: tools: add hint when no exported devices are found 2026-04-11 12:02:00 +02:00
verification verification/rvgen: Fix ltl2k writing True as a literal 2026-06-04 16:44:25 +02:00
virtio tools/virtio: fix build for kmalloc_obj API and missing stubs 2026-06-10 02:16:59 -04:00
wmi
workqueue
writeback
Makefile