[PATCH] x86: move arch_get_vdso_data under CONFIG_TIME_NS

From: Andrei Vagin
Date: Tue Oct 05 2021 - 12:53:21 EST


This patch fixes the warning:
>> vma.c:32:19: warning: no previous prototype for 'arch_get_vdso_data'
32 | struct vdso_data *arch_get_vdso_data(void *vvar_page)
| ^~~~~~~~~~~~~~~~~~

Cc: Dmitry Safonov <0x7f454c46@xxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Andrei Vagin <avagin@xxxxxxxxx>
---
arch/x86/entry/vdso/vma.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index 235a5794296a..427bc56c152b 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -31,11 +31,6 @@
#define EMIT_VVAR(name, offset) \
const size_t name ## _offset = offset;
#include <asm/vvar.h>
-
-struct vdso_data *arch_get_vdso_data(void *vvar_page)
-{
- return (struct vdso_data *)(vvar_page + _vdso_data_offset);
-}
#undef EMIT_VVAR

unsigned int vclocks_used __read_mostly;
@@ -98,6 +93,11 @@ static int vdso_mremap(const struct vm_special_mapping *sm,
}

#ifdef CONFIG_TIME_NS
+struct vdso_data *arch_get_vdso_data(void *vvar_page)
+{
+ return (struct vdso_data *)(vvar_page + _vdso_data_offset);
+}
+
static struct page *find_timens_vvar_page(struct vm_area_struct *vma)
{
if (likely(vma->vm_mm == current->mm))
--
2.31.1