From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2BF3C433FE for ; Thu, 6 Oct 2022 22:48:21 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Mk66X2gTtz3fLy for ; Fri, 7 Oct 2022 09:48:20 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=zx2c4.com header.i=@zx2c4.com header.a=rsa-sha256 header.s=20210105 header.b=FFz7TrE8; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=145.40.68.75; helo=ams.source.kernel.org; envelope-from=srs0=tiop=2h=zx2c4.com=jason@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=zx2c4.com header.i=@zx2c4.com header.a=rsa-sha256 header.s=20210105 header.b=FFz7TrE8; dkim-atps=neutral Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4MjyGS6lHPz3bry for ; Fri, 7 Oct 2022 03:54:40 +1100 (AEDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 78085B8211F; Thu, 6 Oct 2022 16:54:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40F56C433B5; Thu, 6 Oct 2022 16:54:28 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="FFz7TrE8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1665075266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wugUkH0LlLzYfPgynaJ//AEyTMustLSmvE+oyYjIDcM=; b=FFz7TrE8aP9zLhhxK3uSpfoTyzjDq0bxQI30fpdoCXYfWegFK2m6ZPSu3pNQAqVlYDkUIR 0CnyABW7SnfNiMi0WXqnYFETeGuwWucMKsJb0WF37vnebsOE58jPV9HKZ30JYEa0G+DgTH izZ6lZm62mnNDAHNsqJ7hn4ygBLXV3o= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 0c028fd9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 6 Oct 2022 16:54:26 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: [PATCH v3 5/5] prandom: remove unused functions Date: Thu, 6 Oct 2022 10:53:46 -0600 Message-Id: <20221006165346.73159-6-Jason@zx2c4.com> In-Reply-To: <20221006165346.73159-1-Jason@zx2c4.com> References: <20221006165346.73159-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 07 Oct 2022 09:35:18 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, "Jason A. Donenfeld" , x86@kernel.org, Vignesh Raghavendra , linux-doc@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , kernel-janitors@vger.kernel.org, KP Singh , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Eric Dumazet , netdev@vger.kernel.org, linux-mtd@lists.infradead.org, kasan-dev@googlegroups.com, "H . Peter Anvin" , Andreas Noever , WANG Xuerui , Will Deacon , Christoph Hellwig , linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, Mauro Carvalho Chehab , Herbert Xu , Daniel Borkmann , Jonathan Corbet , linux-rdma@vger.kernel.org, Helge Deller , Huacai Chen , Hugh Dickins , Russell King , Jozsef Kadlecsik , Jason Gunthorpe , Dave Airlie , Ulf Hansson , Paolo Abeni , "James E . J . Bottomley" , Pablo Neira Ayuso , linux-media@vger.kernel.org, Marco Elver , Kees Cook , Yury Norov , Heiko Carstens , linux-um@lists.infradead.org, linux-block@vger.kernel.org, Richard Weinberger , Borislav Petkov , linux-nvme@lists.infradead.org, loongarch@lists.linux.dev, Jakub Kicinski , Thomas Gleixner , Andy Shevchenko , Johannes Berg , linux-arm-kernel@lists.infradead.org, Jens Axboe , linux-mmc@vger.kernel.org, Thomas Bogendoerfer , Theodore Ts'o , linux-parisc@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, Florian Westphal , linux-mips@vger.kernel.org, =?UTF-8?q?Christoph=20B=C3=B6hmwalder?= , linux-crypto@vger.kernel.org, Jan Kara , Thomas Graf , linux-fsdevel@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S . Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 Signed-off-by: Jason A. Donenfeld --- 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 #include -/* 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