Skip to contentSkip to conversation

x86: move arch_get_vdso_data under CONFIG_TIME_NS

PATCH In review Andrei Vagin 2 participants 2 messages Oct 5, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: move arch_get_vdso_data under CONFIG_TIME_NS

This patch fixes the warning:

Quoted 1 line
Quoted 1 line

vma.c:32:19: warning: no previous prototype for 'arch_get_vdso_data'

32 | struct vdso_data *arch_get_vdso_data(void *vvar_page)
| ^~~~~~~~~~~~~~~~~~

---
 arch/x86/entry/vdso/vma.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/x86/entry/vdso/vma.c +5 -5
index 235a5794296a..427bc56c152b 100644
@@ -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))
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Andrei Vagin

This patch fixes the warning:

Quoted 1 line
Quoted 1 line

vma.c:32:19: warning: no previous prototype for 'arch_get_vdso_data'

32 | struct vdso_data *arch_get_vdso_data(void *vvar_page)
| ^~~~~~~~~~~~~~~~~~

Thanks for a fast fix!

Signature · 1 line
            Dima