Blob Blame History Raw
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 14 Jan 2020 19:52:38 +0100
Subject: lib/vdso: Make __arch_update_vdso_data() logic understandable
Git-commit: 9a6b55ac4a44060bcb782baf002859b2a2c63267
Patch-mainline: v5.6-rc1
References: bsc#1164141

The function name suggests that this is a boolean checking whether the
architecture asks for an update of the VDSO data, but it works the other
way round. To spare further confusion invert the logic.

Fixes: 44f57d788e7d ("timekeeping: Provide a generic update_vsyscall() implementation")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20200114185946.656652824@linutronix.de
[mb: drop arm part as we miss commit
20e2fc42312f ("ARM: 8930/1: Add support for generic vDSO")
]
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 include/asm-generic/vdso/vsyscall.h  | 4 ++--
 kernel/time/vsyscall.c               | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/asm-generic/vdso/vsyscall.h b/include/asm-generic/vdso/vsyscall.h
index ce4103208619..cec543d9e87b 100644
--- a/include/asm-generic/vdso/vsyscall.h
+++ b/include/asm-generic/vdso/vsyscall.h
@@ -12,9 +12,9 @@ static __always_inline struct vdso_data *__arch_get_k_vdso_data(void)
 #endif /* __arch_get_k_vdso_data */
 
 #ifndef __arch_update_vdso_data
-static __always_inline int __arch_update_vdso_data(void)
+static __always_inline bool __arch_update_vdso_data(void)
 {
-	return 0;
+	return true;
 }
 #endif /* __arch_update_vdso_data */
 
diff --git a/kernel/time/vsyscall.c b/kernel/time/vsyscall.c
index 5ee0f7709410..f0aab6182824 100644
--- a/kernel/time/vsyscall.c
+++ b/kernel/time/vsyscall.c
@@ -84,7 +84,7 @@ void update_vsyscall(struct timekeeper *tk)
 	struct vdso_timestamp *vdso_ts;
 	u64 nsec;
 
-	if (__arch_update_vdso_data()) {
+	if (!__arch_update_vdso_data()) {
 		/*
 		 * Some architectures might want to skip the update of the
 		 * data page.
-- 
2.25.0