提交 f39fee5f 编写于 作者: A Akinobu Mita 提交者: Linus Torvalds

lib/: rename random32() to prandom_u32()

Use preferable function name which implies using a pseudo-random
number generator.
Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 56a1ba5f
......@@ -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))
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册