From: "Jason A. Donenfeld" <Jason@zx2c4•com>
To: linux-kernel@vger•kernel.org, patches@lists•linux.dev
Cc: linux-wireless@vger•kernel.org,
"Jason A. Donenfeld" <Jason@zx2c4•com>,
x86@kernel•org, "Vignesh Raghavendra" <vigneshr@ti•com>,
linux-doc@vger•kernel.org,
"Peter Zijlstra" <peterz@infradead•org>,
"Catalin Marinas" <catalin.marinas@arm•com>,
"Dave Hansen" <dave.hansen@linux•intel.com>,
kernel-janitors@vger•kernel.org, "KP Singh" <kpsingh@kernel•org>,
dri-devel@lists•freedesktop.org, linux-mm@kvack•org,
"Eric Dumazet" <edumazet@google•com>,
netdev@vger•kernel.org, linux-mtd@lists•infradead.org,
kasan-dev@googlegroups•com, "H . Peter Anvin" <hpa@zytor•com>,
"Andreas Noever" <andreas.noever@gmail•com>,
"WANG Xuerui" <kernel@xen0n•name>,
"Will Deacon" <will@kernel•org>, "Christoph Hellwig" <hch@lst•de>,
linux-s390@vger•kernel.org, sparclinux@vger•kernel.org,
"Mauro Carvalho Chehab" <mchehab@kernel•org>,
"Herbert Xu" <herbert@gondor•apana.org.au>,
"Daniel Borkmann" <daniel@iogearbox•net>,
"Jonathan Corbet" <corbet@lwn•net>,
linux-rdma@vger•kernel.org, "Helge Deller" <deller@gmx•de>,
"Huacai Chen" <chenhuacai@kernel•org>,
"Hugh Dickins" <hughd@google•com>,
"Russell King" <linux@armlinux•org.uk>,
"Jozsef Kadlecsik" <kadlec@netfilter•org>,
"Jason Gunthorpe" <jgg@ziepe•ca>,
"Dave Airlie" <airlied@redhat•com>,
"Ulf Hansson" <ulf.hansson@linaro•org>,
"Paolo Abeni" <pabeni@redhat•com>,
"James E . J . Bottomley" <jejb@linux•ibm.com>,
"Pablo Neira Ayuso" <pablo@netfilter•org>,
linux-media@vger•kernel.org, "Marco Elver" <elver@google•com>,
"Kees Cook" <keescook@chromium•org>,
"Yury Norov" <yury.norov@gmail•com>,
"Heiko Carstens" <hca@linux•ibm.com>,
linux-um@lists•infradead.org, linux-block@vger•kernel.org,
"Richard Weinberger" <richard@nod•at>,
"Borislav Petkov" <bp@alien8•de>,
linux-nvme@lists•infradead.org, loongarch@lists•linux.dev,
"Jakub Kicinski" <kuba@kernel•org>,
"Thomas Gleixner" <tglx@linutronix•de>,
"Andy Shevchenko" <andriy.shevchenko@linux•intel.com>,
"Johannes Berg" <johannes@sipsolutions•net>,
linux-arm-kernel@lists•infradead.org,
"Jens Axboe" <axboe@kernel•dk>,
linux-mmc@vger•kernel.org,
"Thomas Bogendoerfer" <tsbogend@alpha•franken.de>,
"Theodore Ts'o" <tytso@mit•edu>,
linux-parisc@vger•kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation•org>,
linux-usb@vger•kernel.org, "Florian Westphal" <fw@strlen•de>,
linux-mips@vger•kernel.org,
"Christoph Böhmwalder" <christoph.boehmwalder@linbit•com>,
linux-crypto@vger•kernel.org, "Jan Kara" <jack@suse•com>,
"Thomas Graf" <tgraf@suug•ch>,
linux-fsdevel@vger•kernel.org,
"Andrew Morton" <akpm@linux-foundation•org>,
linuxppc-dev@lists•ozlabs.org,
"David S . Miller" <davem@davemloft•net>
Subject: [PATCH v3 5/5] prandom: remove unused functions
Date: Thu, 6 Oct 2022 10:53:46 -0600 [thread overview]
Message-ID: <20221006165346.73159-6-Jason@zx2c4.com> (raw)
In-Reply-To: <20221006165346.73159-1-Jason@zx2c4.com>
With no callers left of prandom_u32() and prandom_bytes(), as well as
get_random_int(), remove these deprecated wrappers, in favor of
get_random_u32() and get_random_bytes().
Reviewed-by: Kees Cook <keescook@chromium•org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4•com>
---
drivers/char/random.c | 11 +++++------
include/linux/prandom.h | 12 ------------
include/linux/random.h | 5 -----
3 files changed, 5 insertions(+), 23 deletions(-)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 01acf235f263..2fe28eeb2f38 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -97,7 +97,7 @@ MODULE_PARM_DESC(ratelimit_disable, "Disable random ratelimit suppression");
* Returns whether or not the input pool has been seeded and thus guaranteed
* to supply cryptographically secure random numbers. This applies to: the
* /dev/urandom device, the get_random_bytes function, and the get_random_{u8,
- * u16,u32,u64,int,long} family of functions.
+ * u16,u32,u64,long} family of functions.
*
* Returns: true if the input pool has been seeded.
* false if the input pool has not been seeded.
@@ -161,15 +161,14 @@ EXPORT_SYMBOL(wait_for_random_bytes);
* u16 get_random_u16()
* u32 get_random_u32()
* u64 get_random_u64()
- * unsigned int get_random_int()
* unsigned long get_random_long()
*
* These interfaces will return the requested number of random bytes
* into the given buffer or as a return value. This is equivalent to
- * a read from /dev/urandom. The u8, u16, u32, u64, int, and long
- * family of functions may be higher performance for one-off random
- * integers, because they do a bit of buffering and do not invoke
- * reseeding until the buffer is emptied.
+ * a read from /dev/urandom. The u8, u16, u32, u64, long family of
+ * functions may be higher performance for one-off random integers,
+ * because they do a bit of buffering and do not invoke reseeding
+ * until the buffer is emptied.
*
*********************************************************************/
diff --git a/include/linux/prandom.h b/include/linux/prandom.h
index 78db003bc290..e0a0759dd09c 100644
--- a/include/linux/prandom.h
+++ b/include/linux/prandom.h
@@ -12,18 +12,6 @@
#include <linux/percpu.h>
#include <linux/random.h>
-/* Deprecated: use get_random_u32 instead. */
-static inline u32 prandom_u32(void)
-{
- return get_random_u32();
-}
-
-/* Deprecated: use get_random_bytes instead. */
-static inline void prandom_bytes(void *buf, size_t nbytes)
-{
- return get_random_bytes(buf, nbytes);
-}
-
struct rnd_state {
__u32 s1, s2, s3, s4;
};
diff --git a/include/linux/random.h b/include/linux/random.h
index 08322f700cdc..147a5e0d0b8e 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -42,10 +42,6 @@ u8 get_random_u8(void);
u16 get_random_u16(void);
u32 get_random_u32(void);
u64 get_random_u64(void);
-static inline unsigned int get_random_int(void)
-{
- return get_random_u32();
-}
static inline unsigned long get_random_long(void)
{
#if BITS_PER_LONG == 64
@@ -100,7 +96,6 @@ declare_get_random_var_wait(u8, u8)
declare_get_random_var_wait(u16, u16)
declare_get_random_var_wait(u32, u32)
declare_get_random_var_wait(u64, u32)
-declare_get_random_var_wait(int, unsigned int)
declare_get_random_var_wait(long, unsigned long)
#undef declare_get_random_var
--
2.37.3
next prev parent reply other threads:[~2022-10-06 22:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-06 16:53 [PATCH v3 0/5] treewide cleanup of random integer usage Jason A. Donenfeld
2022-10-06 16:53 ` [PATCH v3 1/5] treewide: use prandom_u32_max() when possible Jason A. Donenfeld
2022-10-06 16:53 ` [PATCH v3 2/5] treewide: use get_random_{u8,u16}() " Jason A. Donenfeld
2022-10-06 16:53 ` [PATCH v3 3/5] treewide: use get_random_u32() " Jason A. Donenfeld
2022-10-06 17:21 ` Christophe Leroy
2022-10-06 17:24 ` Jason A. Donenfeld
2022-10-06 17:31 ` Christophe Leroy
2022-10-06 17:42 ` Christophe Leroy
2022-10-06 23:36 ` Jason A. Donenfeld
2022-10-07 4:57 ` Christophe Leroy
2022-10-07 14:07 ` Jason A. Donenfeld
2022-10-07 17:12 ` Kees Cook
2022-10-07 17:56 ` Jason A. Donenfeld
2022-10-08 21:53 ` David Laight
2022-10-09 2:57 ` Jason A. Donenfeld
2022-10-07 9:14 ` David Laight
2022-10-07 9:26 ` Mika Westerberg
2022-10-06 16:53 ` [PATCH v3 4/5] treewide: use get_random_bytes " Jason A. Donenfeld
2022-10-06 17:22 ` Christophe Leroy
2022-10-07 3:09 ` Bagas Sanjaya
2022-10-07 3:23 ` Jason A. Donenfeld
2022-10-06 16:53 ` Jason A. Donenfeld [this message]
2022-10-07 9:11 ` [PATCH v3 0/5] treewide cleanup of random integer usage Ulf Hansson
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=20221006165346.73159-6-Jason@zx2c4.com \
--to=jason@zx2c4$(echo .)com \
--cc=airlied@redhat$(echo .)com \
--cc=akpm@linux-foundation$(echo .)org \
--cc=andreas.noever@gmail$(echo .)com \
--cc=andriy.shevchenko@linux$(echo .)intel.com \
--cc=axboe@kernel$(echo .)dk \
--cc=bp@alien8$(echo .)de \
--cc=catalin.marinas@arm$(echo .)com \
--cc=chenhuacai@kernel$(echo .)org \
--cc=christoph.boehmwalder@linbit$(echo .)com \
--cc=corbet@lwn$(echo .)net \
--cc=daniel@iogearbox$(echo .)net \
--cc=dave.hansen@linux$(echo .)intel.com \
--cc=davem@davemloft$(echo .)net \
--cc=deller@gmx$(echo .)de \
--cc=dri-devel@lists$(echo .)freedesktop.org \
--cc=edumazet@google$(echo .)com \
--cc=elver@google$(echo .)com \
--cc=fw@strlen$(echo .)de \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=hca@linux$(echo .)ibm.com \
--cc=hch@lst$(echo .)de \
--cc=herbert@gondor$(echo .)apana.org.au \
--cc=hpa@zytor$(echo .)com \
--cc=hughd@google$(echo .)com \
--cc=jack@suse$(echo .)com \
--cc=jejb@linux$(echo .)ibm.com \
--cc=jgg@ziepe$(echo .)ca \
--cc=johannes@sipsolutions$(echo .)net \
--cc=kadlec@netfilter$(echo .)org \
--cc=kasan-dev@googlegroups$(echo .)com \
--cc=keescook@chromium$(echo .)org \
--cc=kernel-janitors@vger$(echo .)kernel.org \
--cc=kernel@xen0n$(echo .)name \
--cc=kpsingh@kernel$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-block@vger$(echo .)kernel.org \
--cc=linux-crypto@vger$(echo .)kernel.org \
--cc=linux-doc@vger$(echo .)kernel.org \
--cc=linux-fsdevel@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-media@vger$(echo .)kernel.org \
--cc=linux-mips@vger$(echo .)kernel.org \
--cc=linux-mm@kvack$(echo .)org \
--cc=linux-mmc@vger$(echo .)kernel.org \
--cc=linux-mtd@lists$(echo .)infradead.org \
--cc=linux-nvme@lists$(echo .)infradead.org \
--cc=linux-parisc@vger$(echo .)kernel.org \
--cc=linux-rdma@vger$(echo .)kernel.org \
--cc=linux-s390@vger$(echo .)kernel.org \
--cc=linux-um@lists$(echo .)infradead.org \
--cc=linux-usb@vger$(echo .)kernel.org \
--cc=linux-wireless@vger$(echo .)kernel.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=loongarch@lists$(echo .)linux.dev \
--cc=mchehab@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=pablo@netfilter$(echo .)org \
--cc=patches@lists$(echo .)linux.dev \
--cc=peterz@infradead$(echo .)org \
--cc=richard@nod$(echo .)at \
--cc=sparclinux@vger$(echo .)kernel.org \
--cc=tglx@linutronix$(echo .)de \
--cc=tgraf@suug$(echo .)ch \
--cc=tsbogend@alpha$(echo .)franken.de \
--cc=tytso@mit$(echo .)edu \
--cc=ulf.hansson@linaro$(echo .)org \
--cc=vigneshr@ti$(echo .)com \
--cc=will@kernel$(echo .)org \
--cc=x86@kernel$(echo .)org \
--cc=yury.norov@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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