All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: linux-kernel@vger.kernel.org, patches@lists.linux.dev
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	"Andreas Noever" <andreas.noever@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>,
	"Christoph Hellwig" <hch@lst.de>,
	"Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Dave Airlie" <airlied@redhat.com>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Florian Westphal" <fw@strlen.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"H . Peter Anvin" <hpa@zytor.com>,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Helge Deller" <deller@gmx.de>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Hugh Dickins" <hughd@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Jan Kara" <jack@suse.com>, "Jason Gunthorpe" <jgg@ziepe.ca>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Jozsef Kadlecsik" <kadlec@netfilter.org>,
	"KP Singh" <kpsingh@kernel.org>,
	"Kees Cook" <keescook@chromium.org>,
	"Marco Elver" <elver@google.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Pablo Neira Ayuso" <pablo@netfilter.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Richard Weinberger" <richard@nod.at>,
	"Russell King" <linux@armlinux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Thomas Graf" <tgraf@suug.ch>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"WANG Xuerui" <kernel@xen0n.name>,
	"Will Deacon" <will@kernel.org>,
	"Yury Norov" <yury.norov@gmail.com>,
	dri-devel@lists.freedesktop.org, kasan-dev@googlegroups.com,
	kernel-janitors@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-block@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-media@vger.kernel.org, linux-mips@vger.kernel.org,
	linux-mm@kvack.org, linux-mmc@vger.kernel.org,
	linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org,
	linux-parisc@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-um@lists.infradead.org,
	linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev,
	netdev@vger.kernel.org, sparclinux@vger.kernel.org,
	x86@kernel.org
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


WARNING: multiple messages have this Message-ID (diff)
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: linux-kernel@vger.kernel.org, patches@lists.linux.dev
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	"Andreas Noever" <andreas.noever@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>,
	"Christoph Hellwig" <hch@lst.de>,
	"Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Dave Airlie" <airlied@redhat.com>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Florian Westphal" <fw@strlen.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"H . Peter Anvin" <hpa@zytor.com>,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Helge Deller" <deller@gmx.de>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Hugh Dickins" <hughd@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Jan Kara" <jack@suse.com>, "Jason Gunthorpe" <jgg@ziepe.ca>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Jozsef Kadlecsik" <kadlec@netfilter.org>,
	"KP Singh" <kpsingh@kernel.org>,
	"Kees Cook" <keescook@chromium.org>,
	"Marco Elver" <elver@google.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Pablo Neira Ayuso" <pablo@netfilter.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Richard Weinberger" <richard@nod.at>,
	"Russell King" <linux@armlinux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Thomas Graf" <tgraf@suug.ch>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"WANG Xuerui" <kernel@xen0n.name>,
	"Will Deacon" <will@kernel.org>,
	"Yury Norov" <yury.norov@gmail.com>,
	dri-devel@lists.freedesktop.org, kasan-dev@googlegroups.com,
	kernel-janitors@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-block@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-media@vger.kernel.org, linux-mips@vger.kernel.org,
	linux-mm@kvack.org, linux-mmc@vger.kernel.org,
	linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org,
	linux-parisc@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-um@lists.infradead.org,
	linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev,
	netdev@vger.kernel.org, sparclinux@vger.kernel.org,
	x86@kernel.org
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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
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,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Helge Deller" <deller@gmx.de>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Hugh Dickins" <hughd@google.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"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


WARNING: multiple messages have this Message-ID (diff)
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


  parent reply	other threads:[~2022-10-06 16:54 UTC|newest]

Thread overview: 109+ 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 ` Jason A. Donenfeld
2022-10-06 16:53 ` Jason A. Donenfeld
2022-10-06 16:53 ` Jason A. Donenfeld
2022-10-06 16:53 ` 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   ` Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 16:53   ` 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   ` Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 16:53 ` [PATCH v3 3/5] treewide: use get_random_u32() " Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 17:21   ` Christophe Leroy
2022-10-06 17:21     ` Christophe Leroy
2022-10-06 17:21     ` Christophe Leroy
2022-10-06 17:21     ` Christophe Leroy
2022-10-06 17:24     ` Jason A. Donenfeld
2022-10-06 17:24       ` Jason A. Donenfeld
2022-10-06 17:24       ` Jason A. Donenfeld
2022-10-06 17:24       ` Jason A. Donenfeld
2022-10-06 17:24       ` Jason A. Donenfeld
2022-10-06 17:31       ` Christophe Leroy
2022-10-06 17:31         ` Christophe Leroy
2022-10-06 17:31         ` Christophe Leroy
2022-10-06 17:31         ` Christophe Leroy
2022-10-06 17:31         ` Christophe Leroy
2022-10-06 17:42         ` Christophe Leroy
2022-10-06 17:42           ` Christophe Leroy
2022-10-06 17:42           ` Christophe Leroy
2022-10-06 17:42           ` Christophe Leroy
2022-10-06 17:42           ` Christophe Leroy
2022-10-06 23:36           ` Jason A. Donenfeld
2022-10-06 23:36             ` Jason A. Donenfeld
2022-10-06 23:36             ` Jason A. Donenfeld
2022-10-06 23:36             ` Jason A. Donenfeld
2022-10-06 23:36             ` Jason A. Donenfeld
2022-10-07  4:57             ` Christophe Leroy
2022-10-07  4:57               ` Christophe Leroy
2022-10-07  4:57               ` Christophe Leroy
2022-10-07  4:57               ` Christophe Leroy
2022-10-07  4:57               ` Christophe Leroy
2022-10-07 14:07               ` Jason A. Donenfeld
2022-10-07 14:07                 ` Jason A. Donenfeld
2022-10-07 14:07                 ` Jason A. Donenfeld
2022-10-07 14:07                 ` Jason A. Donenfeld
2022-10-07 14:07                 ` Jason A. Donenfeld
2022-10-07 17:12                 ` Kees Cook
2022-10-07 17:12                   ` Kees Cook
2022-10-07 17:12                   ` Kees Cook
2022-10-07 17:12                   ` Kees Cook
2022-10-07 17:56                   ` Jason A. Donenfeld
2022-10-07 17:56                     ` Jason A. Donenfeld
2022-10-07 17:56                     ` Jason A. Donenfeld
2022-10-07 17:56                     ` Jason A. Donenfeld
2022-10-07 17:56                     ` Jason A. Donenfeld
2022-10-08 21:53                     ` David Laight
2022-10-08 21:53                       ` David Laight
2022-10-08 21:53                       ` David Laight
2022-10-08 21:53                       ` David Laight
2022-10-08 21:53                       ` David Laight
2022-10-09  2:57                       ` Jason A. Donenfeld
2022-10-09  2:57                         ` Jason A. Donenfeld
2022-10-09  2:57                         ` Jason A. Donenfeld
2022-10-09  2:57                         ` Jason A. Donenfeld
2022-10-09  2:57                         ` Jason A. Donenfeld
2022-10-07  9:14           ` David Laight
2022-10-07  9:14             ` David Laight
2022-10-07  9:14             ` David Laight
2022-10-07  9:14             ` David Laight
2022-10-07  9:14             ` David Laight
2022-10-07  9:26   ` Mika Westerberg
2022-10-07  9:26     ` Mika Westerberg
2022-10-07  9:26     ` Mika Westerberg
2022-10-07  9:26     ` Mika Westerberg
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 16:53   ` Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 17:22   ` Christophe Leroy
2022-10-06 17:22     ` Christophe Leroy
2022-10-06 17:22     ` Christophe Leroy
2022-10-06 17:22     ` Christophe Leroy
2022-10-06 17:22     ` Christophe Leroy
2022-10-07  3:09   ` Bagas Sanjaya
2022-10-07  3:09     ` Bagas Sanjaya
2022-10-07  3:09     ` Bagas Sanjaya
2022-10-07  3:09     ` Bagas Sanjaya
2022-10-07  3:09     ` Bagas Sanjaya
2022-10-07  3:23     ` Jason A. Donenfeld
2022-10-07  3:23       ` Jason A. Donenfeld
2022-10-07  3:23       ` Jason A. Donenfeld
2022-10-07  3:23       ` Jason A. Donenfeld
2022-10-07  3:23       ` Jason A. Donenfeld
2022-10-06 16:53 ` Jason A. Donenfeld [this message]
2022-10-06 16:53   ` [PATCH v3 5/5] prandom: remove unused functions Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-06 16:53   ` Jason A. Donenfeld
2022-10-07  9:11 ` [PATCH v3 0/5] treewide cleanup of random integer usage Ulf Hansson
2022-10-07  9:11   ` Ulf Hansson
2022-10-07  9:11   ` Ulf Hansson
2022-10-07  9:11   ` Ulf Hansson
2022-10-07  9:11   ` 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.com \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreas.noever@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=axboe@kernel.dk \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=chenhuacai@kernel.org \
    --cc=christoph.boehmwalder@linbit.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=corbet@lwn.net \
    --cc=daniel@iogearbox.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=edumazet@google.com \
    --cc=elver@google.com \
    --cc=fw@strlen.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hca@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=hughd@google.com \
    --cc=jack@suse.com \
    --cc=jejb@linux.ibm.com \
    --cc=jgg@ziepe.ca \
    --cc=johannes@sipsolutions.net \
    --cc=kadlec@netfilter.org \
    --cc=kasan-dev@googlegroups.com \
    --cc=keescook@chromium.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kernel@xen0n.name \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=loongarch@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=patches@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=richard@nod.at \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tgraf@suug.ch \
    --cc=tsbogend@alpha.franken.de \
    --cc=tytso@mit.edu \
    --cc=ulf.hansson@linaro.org \
    --cc=vigneshr@ti.com \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=yury.norov@gmail.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.