vdso/timens: Refactor copy-pasted find_timens_vvar_page() helper into one copy
authorJann Horn <jannh@google.com>
Wed, 30 Nov 2022 11:53:20 +0000 (12:53 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 1 Dec 2022 10:35:40 +0000 (11:35 +0100)
commitd6c494e8ee932b2b21ff4b718eebb378e91b3da0
tree90dc53f17eb09172eda357d3c7fc5527b599d811
parente0d3da982c96aeddc1bbf1cf9469dbb9ebdca657
vdso/timens: Refactor copy-pasted find_timens_vvar_page() helper into one copy

find_timens_vvar_page() is not architecture-specific, as can be seen from
how all five per-architecture versions of it are the same.

(arm64, powerpc and riscv are exactly the same; x86 and s390 have two
characters difference inside a comment, less blank lines, and mark the
!CONFIG_TIME_NS version as inline.)

Refactor the five copies into a central copy in kernel/time/namespace.c.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20221130115320.2918447-1-jannh@google.com
arch/arm64/kernel/vdso.c
arch/powerpc/kernel/vdso.c
arch/riscv/kernel/vdso.c
arch/s390/kernel/vdso.c
arch/x86/entry/vdso/vma.c
include/linux/time_namespace.h
kernel/time/namespace.c