lib/vdso: Make __arch_update_vdso_data() logic understandable
authorThomas Gleixner <tglx@linutronix.de>
Tue, 14 Jan 2020 18:52:38 +0000 (19:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:43:49 +0000 (16:43 +0100)
commit 9a6b55ac4a44060bcb782baf002859b2a2c63267 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/asm-generic/vdso/vsyscall.h
kernel/time/vsyscall.c

index ce41032086193dfb98e9ad1b444624d0dee7a207..cec543d9e87bf99304efea9f7771d745630d3f69 100644 (file)
@@ -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 */
 
index 5ee0f77094107486752338021a7e22210bdbec1d..f0aab618282494f511d6b6c69639a68457843fee 100644 (file)
@@ -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.