[1/4] lib: Make prime number generator independently selectable
diff mbox series

Message ID 159067752610.229397.10253900294111245982.stgit@devnote2
State Accepted
Commit d0676871fd52f575cc2bfec4faa2fcbc8af370e8
Headers show
Series
  • selftests, sysctl, lib: Fix prime_numbers and sysctl test to run
Related show

Commit Message

Masami Hiramatsu May 28, 2020, 2:52 p.m. UTC
Make prime number generator independently selectable from
kconfig. This allows us to enable CONFIG_PRIME_NUMBERS=m
and run the tools/testing/selftests/lib/prime_numbers.sh
without other DRM selftest modules.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 lib/math/Kconfig |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Kees Cook May 29, 2020, 5:56 a.m. UTC | #1
On Thu, May 28, 2020 at 11:52:06PM +0900, Masami Hiramatsu wrote:
> Make prime number generator independently selectable from
> kconfig. This allows us to enable CONFIG_PRIME_NUMBERS=m
> and run the tools/testing/selftests/lib/prime_numbers.sh
> without other DRM selftest modules.

Nice catch! I see that tools/testing/selftests/lib/config already has
CONFIG_PRIME_NUMBERS=m (based on this commit log I was expecting to see
it added in the diff, but I see it's not needed).

Reviewed-by: Kees Cook <keescook@chromium.org>
Masami Hiramatsu May 29, 2020, 1:55 p.m. UTC | #2
On Thu, 28 May 2020 22:56:59 -0700
Kees Cook <keescook@chromium.org> wrote:

> On Thu, May 28, 2020 at 11:52:06PM +0900, Masami Hiramatsu wrote:
> > Make prime number generator independently selectable from
> > kconfig. This allows us to enable CONFIG_PRIME_NUMBERS=m
> > and run the tools/testing/selftests/lib/prime_numbers.sh
> > without other DRM selftest modules.
> 
> Nice catch! I see that tools/testing/selftests/lib/config already has
> CONFIG_PRIME_NUMBERS=m (based on this commit log I was expecting to see
> it added in the diff, but I see it's not needed).

Yes, that is the reason why I have found this issue, the "make kselftest-merge"
cannot enable CONFIG_PRIME_NUMBERS=m without this fix. 

> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

Thank you!

> 
> -- 
> Kees Cook
Luis Chamberlain June 1, 2020, 1:15 p.m. UTC | #3
On Thu, May 28, 2020 at 11:52:06PM +0900, Masami Hiramatsu wrote:
> Make prime number generator independently selectable from
> kconfig. This allows us to enable CONFIG_PRIME_NUMBERS=m
> and run the tools/testing/selftests/lib/prime_numbers.sh
> without other DRM selftest modules.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis

Patch
diff mbox series

diff --git a/lib/math/Kconfig b/lib/math/Kconfig
index 15bd50d92308..f19bc9734fa7 100644
--- a/lib/math/Kconfig
+++ b/lib/math/Kconfig
@@ -6,7 +6,12 @@  config CORDIC
 	  calculations are in fixed point. Module will be called cordic.
 
 config PRIME_NUMBERS
-	tristate
+	tristate "Simple prime number generator for testing"
+	help
+	  This option provides a simple prime number generator for test
+	  modules.
+
+	  If unsure, say N.
 
 config RATIONAL
 	bool