Skip to content

Commit

Permalink
lib/: 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 torvalds committed Apr 30, 2013
1 parent 56a1ba5 commit f39fee5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/fault-inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ bool should_fail(struct fault_attr *attr, ssize_t size)
return false;
}

if (attr->probability <= random32() % 100)
if (attr->probability <= prandom_u32() % 100)
return false;

if (!fail_stacktrace(attr))
Expand Down
2 changes: 1 addition & 1 deletion lib/list_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static int __init list_sort_test(void)
goto exit;
}
/* force some equivalencies */
el->value = random32() % (TEST_LIST_LEN/3);
el->value = prandom_u32() % (TEST_LIST_LEN / 3);
el->serial = i;
el->poison1 = TEST_POISON1;
el->poison2 = TEST_POISON2;
Expand Down

0 comments on commit f39fee5

Please sign in to comment.