Jason A. Donenfeld
ec07b34945
random: make random_get_entropy() return an unsigned long
...
commit b0c3e796f2 upstream.
Some implementations were returning type `unsigned long`, while others
that fell back to get_cycles() were implicitly returning a `cycles_t` or
an untyped constant int literal. That makes for weird and confusing
code, and basically all code in the kernel already handled it like it
was an `unsigned long`. I recently tried to handle it as the largest
type it could be, a `cycles_t`, but doing so doesn't really help with
much.
Instead let's just make random_get_entropy() return an unsigned long all
the time. This also matches the commonly used `arch_get_random_long()`
function, so now RDRAND and RDTSC return the same sized integer, which
means one can fallback to the other more gracefully.
Cc: Dominik Brodowski <linux@dominikbrodowski.net >
Cc: Theodore Ts'o <tytso@mit.edu >
Acked-by: Thomas Gleixner <tglx@linutronix.de >
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-06-22 14:11:14 +02:00
..
2021-04-07 14:47:41 +02:00
2022-06-14 18:11:59 +02:00
2021-08-08 09:04:07 +02:00
2021-06-16 11:59:44 +02:00
2022-03-16 13:21:46 +01:00
2021-05-11 14:04:03 +02:00
2022-06-14 18:12:03 +02:00
2021-03-30 14:35:28 +02:00
2021-04-21 12:56:16 +02:00
2021-04-21 12:56:16 +02:00
2021-04-28 13:19:14 +02:00
2021-09-15 09:47:27 +02:00
2022-05-09 09:03:28 +02:00
2021-05-14 09:44:20 +02:00
2022-05-25 09:14:34 +02:00
2022-06-14 18:11:24 +02:00
2021-05-07 10:51:36 +02:00
2022-03-19 13:40:15 +01:00
2021-07-14 16:53:48 +02:00
2022-04-15 14:18:01 +02:00
2022-05-25 09:14:38 +02:00
2021-09-15 09:47:39 +02:00
2022-06-14 18:11:34 +02:00
2021-09-26 14:07:10 +02:00
2021-02-17 10:35:16 +01:00
2021-01-23 15:57:55 +01:00
2021-09-30 10:09:25 +02:00
2021-05-26 12:05:20 +02:00
2021-11-17 09:48:25 +01:00
2022-06-16 13:23:32 +02:00
2022-06-22 14:11:12 +02:00
2021-03-09 11:09:38 +01:00
2021-03-04 10:26:51 +01:00
2021-08-18 08:57:03 +02:00
2021-01-19 18:26:13 +01:00
2022-05-25 09:14:38 +02:00
2021-03-11 14:06:50 +01:00
2022-06-14 18:11:33 +02:00
2021-05-19 10:08:30 +02:00
2021-10-27 09:54:27 +02:00
2021-09-15 09:47:33 +02:00
2022-04-27 13:50:45 +02:00
2021-04-07 14:47:43 +02:00
2021-11-17 09:48:20 +01:00
2022-01-20 09:19:17 +01:00
2021-01-30 13:54:11 +01:00
2021-09-12 08:56:38 +02:00
2022-02-01 17:24:39 +01:00
2022-02-23 11:59:56 +01:00
2022-01-27 09:19:43 +01:00
2021-09-15 09:47:26 +02:00
2021-06-30 08:47:52 -04:00
2021-09-22 12:26:37 +02:00
2022-06-22 14:11:12 +02:00
2021-05-19 10:08:22 +02:00
2021-03-04 10:26:53 +01:00
2022-03-23 09:12:07 +01:00
2021-03-30 14:35:25 +02:00
2021-08-18 08:57:01 +02:00
2021-02-03 23:26:01 +01:00
2021-05-19 10:08:30 +02:00
2021-12-01 09:23:35 +01:00
2022-04-15 14:18:32 +02:00
2021-08-18 08:57:02 +02:00
2021-01-09 13:44:54 +01:00
2022-05-09 09:03:22 +02:00
2021-03-04 10:26:25 +01:00
2021-03-04 10:26:29 +01:00
2021-12-08 09:01:10 +01:00
2021-02-07 15:35:49 +01:00
2021-09-26 14:07:05 +02:00
2021-11-17 09:48:17 +01:00
2021-09-22 12:26:20 +02:00
2021-11-17 09:48:16 +01:00
2022-06-14 18:11:42 +02:00
2021-04-21 12:56:18 +02:00
2022-05-25 09:14:32 +02:00
2021-10-09 14:39:49 +02:00
2022-01-05 12:37:44 +01:00
2021-08-26 08:36:22 -04:00
2021-09-22 12:26:43 +02:00
2021-05-19 10:08:31 +02:00
2021-06-30 08:47:53 -04:00
2021-06-30 08:47:51 -04:00
2022-05-15 19:54:46 +02:00
2021-05-11 14:04:04 +02:00
2021-08-18 08:57:03 +02:00
2021-03-30 14:35:29 +02:00
2022-05-18 09:47:24 +02:00
2022-04-15 14:17:56 +02:00
2022-04-15 14:18:35 +02:00
2022-06-14 18:12:02 +02:00
2021-12-08 09:01:08 +01:00
2021-01-06 14:48:37 +01:00
2021-09-03 10:08:12 +02:00
2021-09-03 10:08:12 +02:00
2021-06-30 08:47:55 -04:00
2021-09-22 12:26:43 +02:00
2021-09-26 14:07:05 +02:00
2022-04-15 14:18:15 +02:00
2022-01-20 09:19:18 +01:00
2020-12-30 11:50:53 +01:00
2021-05-19 10:08:20 +02:00
2021-07-14 16:53:17 +02:00
2020-12-30 11:50:55 +01:00
2021-01-12 20:16:10 +01:00
2022-02-05 12:35:36 +01:00
2022-02-05 12:35:36 +01:00
2021-06-23 14:41:26 +02:00
2022-06-14 18:11:24 +02:00
2022-06-22 14:11:13 +02:00
2021-03-04 10:26:47 +01:00
2021-06-30 08:47:52 -04:00
2021-11-17 09:48:44 +01:00
2021-01-09 13:44:55 +01:00
2022-04-27 13:50:48 +02:00
2022-06-06 08:33:48 +02:00
2020-12-30 11:51:21 +01:00
2021-12-08 09:01:12 +01:00
2021-09-22 12:26:41 +02:00
2021-04-14 08:24:12 +02:00
2021-05-14 09:44:33 +02:00
2021-06-23 14:41:25 +02:00
2022-05-25 09:14:38 +02:00
2021-03-17 17:03:56 +01:00
2022-02-16 12:52:50 +01:00
2021-03-07 12:20:49 +01:00
2021-03-07 12:20:48 +01:00
2022-03-02 11:41:04 +01:00
2021-09-26 14:07:10 +02:00
2021-03-24 11:26:44 +01:00
2021-09-16 12:56:13 +02:00
2022-06-22 14:11:14 +02:00
2022-03-08 19:07:48 +01:00
2020-12-30 11:51:21 +01:00
2021-07-14 16:53:08 +02:00
2021-05-14 09:44:22 +02:00
2021-03-30 14:35:22 +02:00
2021-02-17 10:35:19 +01:00
2021-03-24 11:26:40 +01:00
2022-03-16 13:21:48 +01:00
2021-12-29 12:23:34 +01:00
2022-03-16 13:21:48 +01:00
2021-12-14 14:49:02 +01:00
2021-06-10 13:37:14 +02:00
2021-03-07 12:20:49 +01:00