mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Thomas Weißschuh" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: thomas.weissschuh@linutronix.de,
	Thomas Gleixner <tglx@kernel.org>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/vdso] random: vDSO: Remove ifdeffery
Date: Wed, 11 Mar 2026 09:31:12 -0000	[thread overview]
Message-ID: <177322147280.1647592.12102755147347865641.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260227-vdso-header-cleanups-v2-15-35d60acf7410@linutronix.de>

The following commit has been merged into the timers/vdso branch of tip:

Commit-ID:     4da5ad41949ee8706a604163777e10d1beabf9b5
Gitweb:        https://git.kernel.org/tip/4da5ad41949ee8706a604163777e10d1beabf9b5
Author:        Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate:    Fri, 27 Feb 2026 07:44:41 +01:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Wed, 11 Mar 2026 10:27:39 +01:00

random: vDSO: Remove ifdeffery

Recent cleanups of the vDSO headers allow the unconditional inclusion of
vdso/datapage.h and the declarations it provides. This also means that
the declaration of vdso_k_rng_data is always visible and its usage does
not need to be guarded by ifdefs anymore. Instead use IS_ENABLED().

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Link: https://patch.msgid.link/20260227-vdso-header-cleanups-v2-15-35d60acf7410@linutronix.de
---
 drivers/char/random.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 304cdab..b4da1fb 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -56,9 +56,7 @@
 #include <linux/sched/isolation.h>
 #include <crypto/chacha.h>
 #include <crypto/blake2s.h>
-#ifdef CONFIG_VDSO_GETRANDOM
 #include <vdso/datapage.h>
-#endif
 #include <asm/archrandom.h>
 #include <asm/processor.h>
 #include <asm/irq.h>
@@ -267,7 +265,7 @@ static void crng_reseed(struct work_struct *work)
 	if (next_gen == ULONG_MAX)
 		++next_gen;
 	WRITE_ONCE(base_crng.generation, next_gen);
-#ifdef CONFIG_VDSO_GETRANDOM
+
 	/* base_crng.generation's invalid value is ULONG_MAX, while
 	 * vdso_k_rng_data->generation's invalid value is 0, so add one to the
 	 * former to arrive at the latter. Use smp_store_release so that this
@@ -281,8 +279,9 @@ static void crng_reseed(struct work_struct *work)
 	 * because the vDSO side only checks whether the value changed, without
 	 * actually using or interpreting the value.
 	 */
-	smp_store_release((unsigned long *)&vdso_k_rng_data->generation, next_gen + 1);
-#endif
+	if (IS_ENABLED(CONFIG_VDSO_GETRANDOM))
+		smp_store_release((unsigned long *)&vdso_k_rng_data->generation, next_gen + 1);
+
 	if (!static_branch_likely(&crng_is_ready))
 		crng_init = CRNG_READY;
 	spin_unlock_irqrestore(&base_crng.lock, flags);
@@ -732,9 +731,8 @@ static void __cold _credit_init_bits(size_t bits)
 		if (system_dfl_wq)
 			queue_work(system_dfl_wq, &set_ready);
 		atomic_notifier_call_chain(&random_ready_notifier, 0, NULL);
-#ifdef CONFIG_VDSO_GETRANDOM
-		WRITE_ONCE(vdso_k_rng_data->is_ready, true);
-#endif
+		if (IS_ENABLED(CONFIG_VDSO_GETRANDOM))
+			WRITE_ONCE(vdso_k_rng_data->is_ready, true);
 		wake_up_interruptible(&crng_init_wait);
 		kill_fasync(&fasync, SIGIO, POLL_IN);
 		pr_notice("crng init done\n");

  reply	other threads:[~2026-03-11  9:31 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27  6:44 [PATCH v2 00/15] vDSO: header file cleanups Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 01/15] arm64: vDSO: gettimeofday: Explicitly include vdso/clocksource.h Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 02/15] arm64: vDSO: compat_gettimeofday: Add explicit includes Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 03/15] ARM: vdso: gettimeofday: " Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 04/15] powerpc/vdso/gettimeofday: Explicitly include vdso/time32.h Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 05/15] powerpc/vdso: Explicitly include asm/cputable.h and asm/feature-fixups.h Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 06/15] LoongArch: vDSO: Explicitly include asm/vdso/vdso.h Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 07/15] MIPS: vdso: Add include guard to asm/vdso/vdso.h Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 08/15] MIPS: vdso: Explicitly include asm/vdso/vdso.h Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 09/15] random: vDSO: add explicit includes Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] random: vDSO: Add " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 10/15] vdso/gettimeofday: " Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 11/15] vdso/helpers: Explicitly include vdso/processor.h Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 12/15] vdso/datapage: Remove inclusion of gettimeofday.h Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 13/15] vdso/datapage: Trim down unnecessary includes Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 14/15] random: vDSO: trim vDSO includes Thomas Weißschuh
2026-03-11  9:31   ` [tip: timers/vdso] random: vDSO: Trim " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51   ` tip-bot2 for Thomas Weißschuh
2026-02-27  6:44 ` [PATCH v2 15/15] random: vDSO: remove ifdeffery Thomas Weißschuh
2026-03-11  9:31   ` tip-bot2 for Thomas Weißschuh [this message]
2026-03-11 14:51   ` [tip: timers/vdso] random: vDSO: Remove ifdeffery tip-bot2 for Thomas Weißschuh
  -- strict thread matches above, loose matches on Subject: below --
2025-10-14  6:49 [PATCH v4 17/35] random: vDSO: remove ifdeffery Thomas Weißschuh
2025-11-01 19:47 ` [tip: timers/vdso] random: vDSO: Remove ifdeffery tip-bot2 for 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=177322147280.1647592.12102755147347865641.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=Jason@zx2c4.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®