From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] lib: random: make srand_xor a no-op in PBL
Date: Tue, 29 Apr 2025 09:56:05 +0200 [thread overview]
Message-ID: <20250429075605.3012311-1-a.fatoum@pengutronix.de> (raw)
We are going to add srand_xor calls at more places in future, so do not
trigger a BUG() for it on use in PBL. There is still a BUG() call in
random32 and friends, so use of unseeded PRNG won't get unnoticed.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
This replaces
https://lore.barebox.org/barebox/174555956247.545067.10905121643082274040.b4-ty@pengutronix.de/T/#t
But there is no breakage if both are applied at the same time.
---
include/stdlib.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/include/stdlib.h b/include/stdlib.h
index f0f7cfd2ed28..18f58abad988 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -21,10 +21,7 @@ static inline void randbuf_r(u64 *x, void *buf, size_t len)
{
BUG();
}
-static inline void srand_xor(u64 entropy)
-{
- BUG();
-}
+static inline void srand_xor(u64 entropy) { }
static inline u32 random32(void)
{
BUG();
--
2.39.5
next reply other threads:[~2025-04-29 7:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 7:56 Ahmad Fatoum [this message]
2025-04-29 14:57 ` Sascha Hauer
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=20250429075605.3012311-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.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