mirror of https://gitee.com/openkylin/linux.git
lguest: rename random32() to prandom_u32()
Use preferable function name which implies using a pseudo-random number generator. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
7878202326
commit
10fdc14112
|
@ -686,7 +686,7 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
|
|||
* We pick one entry at random to throw out. Choosing the Least
|
||||
* Recently Used might be better, but this is easy.
|
||||
*/
|
||||
next = random32() % ARRAY_SIZE(cpu->lg->pgdirs);
|
||||
next = prandom_u32() % ARRAY_SIZE(cpu->lg->pgdirs);
|
||||
/* If it's never been allocated at all before, try now. */
|
||||
if (!cpu->lg->pgdirs[next].pgdir) {
|
||||
cpu->lg->pgdirs[next].pgdir =
|
||||
|
|
Loading…
Reference in New Issue