mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 08:52:27 +00:00
Prime numbers are interesting for testing components that use multiplies and divides, such as testing DRM's struct drm_mm alignment computations. v2: Move to lib/, add selftest v3: Fix initial constants (exclude 0/1 from being primes) v4: More RCU markup to keep 0day/sparse happy v5: Fix RCU unwind on module exit, add to kselftests v6: Tidy computation of bitmap size v7: for_each_prime_number_from() v8: Compose small-primes using BIT() for easier verification v9: Move rcu dance entirely into callers. v10: Improve quote for Betrand's Postulate (aka Chebyshev's theorem) Signed-off-by: Chris Wilson <[email protected]> Cc: Lukas Wunner <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
16 lines
327 B
Bash
Executable File
16 lines
327 B
Bash
Executable File
#!/bin/sh
|
|
# Checks fast/slow prime_number generation for inconsistencies
|
|
|
|
if ! /sbin/modprobe -q -r prime_numbers; then
|
|
echo "prime_numbers: [SKIP]"
|
|
exit 77
|
|
fi
|
|
|
|
if /sbin/modprobe -q prime_numbers selftest=65536; then
|
|
/sbin/modprobe -q -r prime_numbers
|
|
echo "prime_numbers: ok"
|
|
else
|
|
echo "prime_numbers: [FAIL]"
|
|
exit 1
|
|
fi
|