arch/x86/entry/vdso/vma.c | 4 ---- 1 file changed, 4 deletions(-)
Sparse complains rightfully when CONFIG_PARAVIRT_CLOCK and
CONFIG_HYPERV_TIMER are both not set:
arch/x86/entry/vdso/vma.c:94:9: warning: switch with no cases
The ifdeffery is not actually necessary as the compiler can optimize away
the branches already if these config options are not set.
Remove the ifdeffery to make the code simpler and sparse happy.
Reported-by: Thomas Gleixner <tglx@kernel.org>
Closes: https://lore.kernel.org/lkml/20260117215542.405790227@kernel.org/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
The other patch from the linked series will be handled in another series.
---
arch/x86/entry/vdso/vma.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index e7fd7517370f..a6bfcc8243cd 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -88,7 +88,6 @@ static vm_fault_t vvar_vclock_fault(const struct vm_special_mapping *sm,
struct vm_area_struct *vma, struct vm_fault *vmf)
{
switch (vmf->pgoff) {
-#ifdef CONFIG_PARAVIRT_CLOCK
case VDSO_PAGE_PVCLOCK_OFFSET:
{
struct pvclock_vsyscall_time_info *pvti =
@@ -100,8 +99,6 @@ static vm_fault_t vvar_vclock_fault(const struct vm_special_mapping *sm,
pgprot_decrypted(vma->vm_page_prot));
break;
}
-#endif /* CONFIG_PARAVIRT_CLOCK */
-#ifdef CONFIG_HYPERV_TIMER
case VDSO_PAGE_HVCLOCK_OFFSET:
{
unsigned long pfn = hv_get_tsc_pfn();
@@ -109,7 +106,6 @@ static vm_fault_t vvar_vclock_fault(const struct vm_special_mapping *sm,
return vmf_insert_pfn(vma, vmf->address, pfn);
break;
}
-#endif /* CONFIG_HYPERV_TIMER */
}
return VM_FAULT_SIGBUS;
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260212-vdso-x86-ifdef-7f46624aad8b
Best regards,
--
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
The following commit has been merged into the x86/vdso branch of tip:
Commit-ID: 6ccd0843b939669159f7148dfb84e6794ca6f4a8
Gitweb: https://git.kernel.org/tip/6ccd0843b939669159f7148dfb84e6794ca6f4a8
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Tue, 31 Mar 2026 09:58:54 +02:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 31 Mar 2026 10:06:39 +02:00
x86/vdso: Drop pointless #ifdeffery in vvar_vclock_fault()
Sparse complains rightfully when CONFIG_PARAVIRT_CLOCK and
CONFIG_HYPERV_TIMER are both not set:
arch/x86/entry/vdso/vma.c:94:9: warning: switch with no cases
The #ifdeffery is not actually necessary as the compiler can optimize away
the branches already if these config options are not set.
Remove the #ifdeffery to make the code simpler and Sparse happy.
Closes: https://lore.kernel.org/lkml/20260117215542.405790227@kernel.org/
Reported-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Andy Lutomirski <luto@kernel.org>
Link: https://patch.msgid.link/20260331-vdso-x86-ifdef-v1-1-6be9a58b1e7e@linutronix.de
---
arch/x86/entry/vdso/vma.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index e7fd751..a6bfcc8 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -88,7 +88,6 @@ static vm_fault_t vvar_vclock_fault(const struct vm_special_mapping *sm,
struct vm_area_struct *vma, struct vm_fault *vmf)
{
switch (vmf->pgoff) {
-#ifdef CONFIG_PARAVIRT_CLOCK
case VDSO_PAGE_PVCLOCK_OFFSET:
{
struct pvclock_vsyscall_time_info *pvti =
@@ -100,8 +99,6 @@ static vm_fault_t vvar_vclock_fault(const struct vm_special_mapping *sm,
pgprot_decrypted(vma->vm_page_prot));
break;
}
-#endif /* CONFIG_PARAVIRT_CLOCK */
-#ifdef CONFIG_HYPERV_TIMER
case VDSO_PAGE_HVCLOCK_OFFSET:
{
unsigned long pfn = hv_get_tsc_pfn();
@@ -109,7 +106,6 @@ static vm_fault_t vvar_vclock_fault(const struct vm_special_mapping *sm,
return vmf_insert_pfn(vma, vmf->address, pfn);
break;
}
-#endif /* CONFIG_HYPERV_TIMER */
}
return VM_FAULT_SIGBUS;
© 2016 - 2026 Red Hat, Inc.