Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\math\prime_numbers.c Create Date:2022-07-28 06:43:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:selftest

Proto:static int selftest(unsigned long max)

Type:int

Parameter:

TypeParameterName
unsigned longmax
268  If Not max Then Return 0
271  When x < max cycle
272  slow = slow_is_prime_number(x)
273  fast = s_prime_number - test whether the given number is prime*@x: the number to test* A prime number is an integer greater than 1 that is only divisible by* itself and 1
275  If slow != fast Then
276  pr_err("inconsistent result for is-prime(%lu): slow=%s, fast=%s!", x, slow ? "yes" : "no", fast ? "yes" : "no")
278  Go to err
281  If Not slow Then Continue
287  Go to err
289  last = x
292  pr_info("selftest(%lu) passed, last prime was %lu", x, last)
293  Return 0
295  err :
296  dump_primes()
297  Return -EINVAL
Caller
NameDescribe
primes_init