Skip to content

Commit

Permalink
kernel/: rename random32() to prandom_u32()
Browse files Browse the repository at this point in the history
Use preferable function name which implies using a pseudo-random
number generator.

Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mita authored and nikhil18 committed Dec 14, 2015
1 parent 3217649 commit f8800c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kernel/rcutree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ static int rcu_gp_init(struct rcu_state *rsp)
rnp->grphi, rnp->qsmask);
raw_spin_unlock_irq(&rnp->lock);
#ifdef CONFIG_PROVE_RCU_DELAY
if ((random32() % (rcu_num_nodes * 8)) == 0 &&
if ((prandom_u32() % (rcu_num_nodes * 8)) == 0 &&
system_state == SYSTEM_RUNNING)
schedule_timeout_uninterruptible(2);
#endif /* #ifdef CONFIG_PROVE_RCU_DELAY */
Expand Down
2 changes: 1 addition & 1 deletion kernel/test_kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ int init_test_probes(void)
target2 = kprobe_target2;

do {
rand1 = random32();
rand1 = prandom_u32();
} while (rand1 <= div_factor);

printk(KERN_INFO "Kprobe smoke test started\n");
Expand Down

0 comments on commit f8800c8

Please sign in to comment.