mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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 <keescook@chromium.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Darrick J. Wong <djwong@kernel.org> # for xfs Reviewed-by: SeongJae Park <sj@kernel.org> # for damon Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> # for infiniband Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> # for arm Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # for mmc Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
7f576b2593
commit
8032bf1233
132 changed files with 280 additions and 280 deletions
|
@ -21,7 +21,7 @@ static int init_alloc_hint(struct sbitmap *sb, gfp_t flags)
|
|||
int i;
|
||||
|
||||
for_each_possible_cpu(i)
|
||||
*per_cpu_ptr(sb->alloc_hint, i) = prandom_u32_max(depth);
|
||||
*per_cpu_ptr(sb->alloc_hint, i) = get_random_u32_below(depth);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ static inline unsigned update_alloc_hint_before_get(struct sbitmap *sb,
|
|||
|
||||
hint = this_cpu_read(*sb->alloc_hint);
|
||||
if (unlikely(hint >= depth)) {
|
||||
hint = depth ? prandom_u32_max(depth) : 0;
|
||||
hint = depth ? get_random_u32_below(depth) : 0;
|
||||
this_cpu_write(*sb->alloc_hint, hint);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue