From nobody Thu Apr 9 13:38:32 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9FEA3F0771; Fri, 27 Feb 2026 06:44:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772174694; cv=none; b=alcESyH4q2BLthAAjA3nd7Sw/H7uc96jLs6mDhHY/4BGAbVGKS4CP/UQQahHUaOejqr7oQrLWt8ovIBvd44D57InZmJIUl78HjinYsGYpJiDXow289I7QwHgf1mENoSEhuedHLtfyqu7HIU/c/rmbDqWU77XjBXRZtFk4Jv32dA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772174694; c=relaxed/simple; bh=Tai+RXoFwVJhTM1dVEO+ykZdBlXqme/L2pcT98/4EtE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O1B7jbg8cnAiN6J3CtoWVP259GVTMLOebjTfpbHRz2M7yJoD+gbaf8mQo7xvYL7CLpga8Bd1QNgIr2eOVA8Fq0SM3IvzWMnWoyUDG7aK1jNKMua9yw/KY45c8o7xE4Ns1Jwx7MC5d0sxC+xHBkwyQwDYWEgQZ3FGMEHWVxvR/K4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=EHWp83mU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=MtHTIOHE; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EHWp83mU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="MtHTIOHE" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772174691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=73eqjBr6NZdEDnZXr1CPa++8UKXkeQebz204fUBPgxU=; b=EHWp83mUC9sqmCRL4lC99TpnbEb3A1GXb9+8KiMgnvutKxhoh6utIAiDJXzxKuL7tAADAx iHAb6kk9DIQaXTIB6jAYTCkJyhL/rjxv5hqpKmLPgE1b8lU9UQTu1mc/IxpaHelkXHCtQL FLe17kLwGuRpzLrDw329bgv2GfKC9zt5KuIo5EdESzn6T9UIcT2Efv+VA/4BpjpqawtkKd qYWKxnAXyfV7qTW7J6bc15aseZDwryfZ4cTzpGQbqMyKuOgw210GVKaOmYfkzslrfNlbSS v8Yyz29fLRhdRzJjxPOAt10CE191nkq/ZjaxhwRWaTUpenLnYffBSoMaCgoqmg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772174691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=73eqjBr6NZdEDnZXr1CPa++8UKXkeQebz204fUBPgxU=; b=MtHTIOHEnRpdXAih0ezpTAU9FGMaQ+i+ctr8UJ10a4fIOdQ5bXYUN/9BltCsSFq81bdVZS aFb1AxBAaXAzQTDw== Date: Fri, 27 Feb 2026 07:44:41 +0100 Subject: [PATCH v2 15/15] random: vDSO: remove ifdeffery Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260227-vdso-header-cleanups-v2-15-35d60acf7410@linutronix.de> References: <20260227-vdso-header-cleanups-v2-0-35d60acf7410@linutronix.de> In-Reply-To: <20260227-vdso-header-cleanups-v2-0-35d60acf7410@linutronix.de> To: Catalin Marinas , Will Deacon , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Theodore Ts'o , "Jason A. Donenfeld" Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772174681; l=2411; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Tai+RXoFwVJhTM1dVEO+ykZdBlXqme/L2pcT98/4EtE=; b=ylxvWJ/shVYJ8y0GfPnPSP2H8OGGFINUoMx2uEfocZT8keFFPHG+Sq9+BcBiIFrHUqvkQu0kT Bawf8udB+4qA110MV9KRLcG7mRXhNKdUvusDTpEXgKSWR2rtnAUXJyT X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= 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=C3=9Fschuh Reviewed-by: Jason A. Donenfeld --- 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 9738673018f3..9392a45852ec 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -56,9 +56,7 @@ #include #include #include -#ifdef CONFIG_VDSO_GETRANDOM #include -#endif #include #include #include @@ -274,7 +272,7 @@ static void crng_reseed(struct work_struct *work) if (next_gen =3D=3D 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 @@ -288,8 +286,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_ge= n + 1); + if (!static_branch_likely(&crng_is_ready)) crng_init =3D CRNG_READY; spin_unlock_irqrestore(&base_crng.lock, flags); @@ -742,9 +741,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"); --=20 2.53.0