]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
random: remove unused get_random_var_wait functions
authorEric Biggers <ebiggers@kernel.org>
Sun, 2 Nov 2025 04:19:41 +0000 (21:19 -0700)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 2 Nov 2025 12:40:13 +0000 (13:40 +0100)
None of these functions are used, so remove them.

This renders the two bugs moot:

- get_random_u64_wait() used the wrong pointer type, making it provide
  only 32 bits.

- The '#undef' directive used the wrong identifier, leaving the helper
  macro defined.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
include/linux/random.h

index 333cecfca93fdad8fdfe68b03380c01c71f533f2..8a8064dc3970bf35e5c2cf98967c67c6090c086f 100644 (file)
@@ -130,21 +130,6 @@ static inline int get_random_bytes_wait(void *buf, size_t nbytes)
        return ret;
 }
 
-#define declare_get_random_var_wait(name, ret_type) \
-       static inline int get_random_ ## name ## _wait(ret_type *out) { \
-               int ret = wait_for_random_bytes(); \
-               if (unlikely(ret)) \
-                       return ret; \
-               *out = get_random_ ## name(); \
-               return 0; \
-       }
-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(long, unsigned long)
-#undef declare_get_random_var
-
 #ifdef CONFIG_SMP
 int random_prepare_cpu(unsigned int cpu);
 int random_online_cpu(unsigned int cpu);