diff options
| author | Jason A. Donenfeld <[email protected]> | 2022-10-10 02:44:02 +0000 |
|---|---|---|
| committer | Jason A. Donenfeld <[email protected]> | 2022-11-18 01:15:15 +0000 |
| commit | 8032bf1233a74627ce69b803608e650f3f35971c (patch) | |
| tree | 1e15cd719358130192c59b8d5a61a0c3c9fbe82c /net/sunrpc/cache.c | |
| parent | random: add helpers for random numbers with given floor or range (diff) | |
| download | kernel-8032bf1233a74627ce69b803608e650f3f35971c.tar.gz kernel-8032bf1233a74627ce69b803608e650f3f35971c.zip | |
treewide: use get_random_u32_below() instead of deprecated function
This is a simple mechanical transformation done by:
@@
expression E;
@@
- prandom_u32_max
+ get_random_u32_below
(E)
Reviewed-by: Kees Cook <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Darrick J. Wong <[email protected]> # for xfs
Reviewed-by: SeongJae Park <[email protected]> # for damon
Reviewed-by: Jason Gunthorpe <[email protected]> # for infiniband
Reviewed-by: Russell King (Oracle) <[email protected]> # for arm
Acked-by: Ulf Hansson <[email protected]> # for mmc
Signed-off-by: Jason A. Donenfeld <[email protected]>
Diffstat (limited to 'net/sunrpc/cache.c')
| -rw-r--r-- | net/sunrpc/cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index f075a9fb5ccc..95ff74706104 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -677,7 +677,7 @@ static void cache_limit_defers(void) /* Consider removing either the first or the last */ if (cache_defer_cnt > DFR_MAX) { - if (prandom_u32_max(2)) + if (get_random_u32_below(2)) discard = list_entry(cache_defer_list.next, struct cache_deferred_req, recent); else |
