From: Thomas Gleixner <tglx@kernel.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Arnd Bergmann" <arnd@arndb.de>,
"Andy Lutomirski" <luto@kernel.org>,
"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nsc@kernel.org>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"Daniel Lezcano" <daniel.lezcano@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Marc Zyngier" <maz@kernel.org>, "Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Huacai Chen" <chenhuacai@kernel.org>,
"WANG Xuerui" <kernel@xen0n.name>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kbuild@vger.kernel.org, linux-mips@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-riscv@lists.infradead.org, loongarch@lists.linux.dev,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: Re: [PATCH 3/7] MIPS: csrc-r4k: Replace CONFIG_GENERIC_GETTIMEOFDAY ifdeffery with IS_ENABLED()
Date: Wed, 15 Jul 2026 10:25:19 +0200 [thread overview]
Message-ID: <87wluwoe1c.ffs@fw13> (raw)
In-Reply-To: <20260709-vdso-arch-clockmodes-v1-3-3fd780bbf851@linutronix.de>
On Thu, Jul 09 2026 at 13:32, Thomas Weißschuh wrote:
> Now that there is a dummy declaration of VDSO_CLOCKMODE_R4K, even if no
> vDSO is built, the ugly ifdeffery can be replaced with a cleaner
> IS_ENABLED() check.
Duh. This stuff is really obfuscated. I just realized that the previous
one actually expands the architecture defines to non-defined integer
variable declarations.
Smart, but seriously?
I just double checked and it turns out that none of this ifdeffery is
required. If CONFIG_GENERIC_GETTIMEOFDAY is disabled, then it does not
matter at all whether the actual ARCH_CLOCK_VDSO_MODE is set in
clocksource::vdso_mode or not.
Nothing uses the vdso mode field outside of update_vsyscall and that's
compiled out when CONFIG_GENERIC_GETTIMEOFDAY=n.
So all what's required is:
--- a/include/vdso/clocksource.h
+++ b/include/vdso/clocksource.h
@@ -3,14 +3,11 @@
#define __VDSO_CLOCKSOURCE_H
#include <vdso/limits.h>
-
-#ifdef CONFIG_GENERIC_GETTIMEOFDAY
#include <asm/vdso/clocksource.h>
-#endif /* CONFIG_GENERIC_GETTIMEOFDAY */
enum vdso_clock_mode {
VDSO_CLOCKMODE_NONE,
-#ifdef CONFIG_GENERIC_GETTIMEOFDAY
+#ifdef VDSO_ARCH_CLOCKMODES
VDSO_ARCH_CLOCKMODES,
#endif
VDSO_CLOCKMODE_MAX,
and then you can just unconditionally set clocksource::vdso_clock_mode
in all drivers.
No?
Thanks,
tglx
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Gleixner <tglx@kernel.org>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Arnd Bergmann" <arnd@arndb.de>,
"Andy Lutomirski" <luto@kernel.org>,
"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nsc@kernel.org>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
"Daniel Lezcano" <daniel.lezcano@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Marc Zyngier" <maz@kernel.org>, "Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Huacai Chen" <chenhuacai@kernel.org>,
"WANG Xuerui" <kernel@xen0n.name>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kbuild@vger.kernel.org, linux-mips@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-riscv@lists.infradead.org, loongarch@lists.linux.dev,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: Re: [PATCH 3/7] MIPS: csrc-r4k: Replace CONFIG_GENERIC_GETTIMEOFDAY ifdeffery with IS_ENABLED()
Date: Wed, 15 Jul 2026 10:25:19 +0200 [thread overview]
Message-ID: <87wluwoe1c.ffs@fw13> (raw)
In-Reply-To: <20260709-vdso-arch-clockmodes-v1-3-3fd780bbf851@linutronix.de>
On Thu, Jul 09 2026 at 13:32, Thomas Weißschuh wrote:
> Now that there is a dummy declaration of VDSO_CLOCKMODE_R4K, even if no
> vDSO is built, the ugly ifdeffery can be replaced with a cleaner
> IS_ENABLED() check.
Duh. This stuff is really obfuscated. I just realized that the previous
one actually expands the architecture defines to non-defined integer
variable declarations.
Smart, but seriously?
I just double checked and it turns out that none of this ifdeffery is
required. If CONFIG_GENERIC_GETTIMEOFDAY is disabled, then it does not
matter at all whether the actual ARCH_CLOCK_VDSO_MODE is set in
clocksource::vdso_mode or not.
Nothing uses the vdso mode field outside of update_vsyscall and that's
compiled out when CONFIG_GENERIC_GETTIMEOFDAY=n.
So all what's required is:
--- a/include/vdso/clocksource.h
+++ b/include/vdso/clocksource.h
@@ -3,14 +3,11 @@
#define __VDSO_CLOCKSOURCE_H
#include <vdso/limits.h>
-
-#ifdef CONFIG_GENERIC_GETTIMEOFDAY
#include <asm/vdso/clocksource.h>
-#endif /* CONFIG_GENERIC_GETTIMEOFDAY */
enum vdso_clock_mode {
VDSO_CLOCKMODE_NONE,
-#ifdef CONFIG_GENERIC_GETTIMEOFDAY
+#ifdef VDSO_ARCH_CLOCKMODES
VDSO_ARCH_CLOCKMODES,
#endif
VDSO_CLOCKMODE_MAX,
and then you can just unconditionally set clocksource::vdso_clock_mode
in all drivers.
No?
Thanks,
tglx
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2026-07-15 8:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 11:32 [PATCH 0/7] vDSO: Replace CONFIG_GENERIC_GETTIMEOFDAY ifdeffery with IS_ENABLED() Thomas Weißschuh
2026-07-09 11:32 ` Thomas Weißschuh
2026-07-09 11:32 ` [PATCH 1/7] kbuild: support generated asm-headers in subdirectories Thomas Weißschuh
2026-07-09 11:32 ` Thomas Weißschuh
2026-07-09 11:32 ` [PATCH 2/7] vDSO: Make clockmode constants available without CONFIG_GENERIC_GETTIMEOFDAY Thomas Weißschuh
2026-07-09 11:32 ` Thomas Weißschuh
2026-07-15 7:29 ` Thomas Gleixner
2026-07-15 7:29 ` Thomas Gleixner
2026-07-15 7:35 ` Thomas Weißschuh
2026-07-15 7:35 ` Thomas Weißschuh
2026-07-09 11:32 ` [PATCH 3/7] MIPS: csrc-r4k: Replace CONFIG_GENERIC_GETTIMEOFDAY ifdeffery with IS_ENABLED() Thomas Weißschuh
2026-07-09 11:32 ` Thomas Weißschuh
2026-07-15 8:25 ` Thomas Gleixner [this message]
2026-07-15 8:25 ` Thomas Gleixner
2026-07-15 8:43 ` Thomas Weißschuh
2026-07-15 8:43 ` Thomas Weißschuh
2026-07-15 9:03 ` Thomas Gleixner
2026-07-15 9:03 ` Thomas Gleixner
2026-07-15 10:13 ` Arnd Bergmann
2026-07-15 10:13 ` Arnd Bergmann
2026-07-15 11:06 ` Thomas Weißschuh
2026-07-15 11:06 ` Thomas Weißschuh
2026-07-09 11:32 ` [PATCH 4/7] clocksource/drivers/mips-gic-timer: " Thomas Weißschuh
2026-07-09 11:32 ` Thomas Weißschuh
2026-07-09 11:32 ` [PATCH 5/7] clocksource/drivers/arm_arch_timer: " Thomas Weißschuh
2026-07-09 11:32 ` Thomas Weißschuh
2026-07-13 15:23 ` Marc Zyngier
2026-07-13 15:23 ` Marc Zyngier
2026-07-09 11:32 ` [PATCH 6/7] clocksource/drivers/timer-riscv: " Thomas Weißschuh
2026-07-09 11:32 ` Thomas Weißschuh
2026-07-09 11:32 ` [PATCH 7/7] LoongArch: " Thomas Weißschuh
2026-07-09 11:32 ` Thomas Weißschuh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wluwoe1c.ffs@fw13 \
--to=tglx@kernel.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=chenhuacai@kernel.org \
--cc=daniel.lezcano@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=luto@kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=thomas.weissschuh@linutronix.de \
--cc=tsbogend@alpha.franken.de \
--cc=vincenzo.frascino@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.