[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260119081424-d789301c-357b-4921-94c4-f9ce2de8e8a7@linutronix.de>
Date: Mon, 19 Jan 2026 08:16:28 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Thomas Gleixner <tglx@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, x86@...nel.org
Subject: Re: [patch 2/2] x86/vdso: Prevent empty switch case warning
Hi,
On Sat, Jan 17, 2026 at 10:58:27PM +0100, Thomas Gleixner wrote:
> 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
>
> Add a default case to fix that.
>
> Signed-off-by: Thomas Gleixner <tglx@...nel.org>
> ---
> arch/x86/entry/vdso/vma.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> --- a/arch/x86/entry/vdso/vma.c
> +++ b/arch/x86/entry/vdso/vma.c
> @@ -114,6 +114,8 @@ static vm_fault_t vvar_vclock_fault(cons
> break;
> }
> #endif /* CONFIG_HYPERV_TIMER */
> + default:
> + break;
This makes the code uglier only to pacify sparse.
It turns out all the necessary stub functions are in place to just
delete the ifdefs altogether. Maybe replace them with IS_ENABLED()
to make it clearer to reader what is going on.
> }
>
> return VM_FAULT_SIGBUS;
>
Powered by blists - more mailing lists