From cf4a7207b1cb4a3c3fe3aa11a83c9d673722a7f5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 22 Dec 2016 14:45:14 +0000 Subject: lib: Add a simple prime number generator 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 Cc: Lukas Wunner Reviewed-by: Joonas Lahtinen Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20161222144514.3911-1-chris@chris-wilson.co.uk --- lib/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Kconfig') diff --git a/lib/Kconfig b/lib/Kconfig index 260a80e313b9..1788a1f50d28 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -550,4 +550,11 @@ config STACKDEPOT config SBITMAP bool +config PRIME_NUMBERS + tristate "Prime number generator" + default n + help + Provides a helper module to generate prime numbers. Useful for writing + test code, especially when checking multiplication and divison. + endmenu -- cgit v1.2.1 From 64a577196d66b44e37384bc5c4d78c61f59d5b2a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 24 Feb 2017 12:11:21 +1000 Subject: lib/Kconfig: make PRIME_NUMBERS not user selectable. Linus doesn't like it user selectable, so kill it until someone needs it for something else. Signed-off-by: Dave Airlie --- lib/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Kconfig') diff --git a/lib/Kconfig b/lib/Kconfig index 1788a1f50d28..f4193a3d9301 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -551,7 +551,7 @@ config SBITMAP bool config PRIME_NUMBERS - tristate "Prime number generator" + tristate default n help Provides a helper module to generate prime numbers. Useful for writing -- cgit v1.2.1