Skip to contentSkip to conversation

cpumask: limit visibility of FORCE_NR_CPUS

PATCH Applied Yury Norov 2 participants 2 messages Nov 16, 2022 Library code

lore
Share & tools
lore

Yury Norov

author
#0 lore raw

PATCH v3 1/1 cpumask: limit visibility of FORCE_NR_CPUS

In current form, FORCE_NR_CPUS is visible to all users building their kernels, even not experts. It is also set in allmodconfig or allyesconfig, which is not a correct behavior.

This patch fixes it. It also changes the parameter short description:
removes implementation details and highlights the effect of the change.

---
v3: instead of 'choice', use !COMPILE_TEST to disable FORCE_NR_CPUS
in all{yes,mod}config, as suggested by Linus.

 lib/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/Kconfig +2 -2
index 9bbf8a4b2108..404647cd3fac 100644
@@ -529,8 +529,8 @@ config CPUMASK_OFFSTACK
 	  stack overflow.
 
 config FORCE_NR_CPUS
-       bool "NR_CPUS is set to an actual number of CPUs"
-       depends on SMP
+       bool "Set number of CPUs at compile time"
+       depends on SMP && EXPERT && !COMPILE_TEST
        help
          Say Yes if you have NR_CPUS set to an actual number of possible
          CPUs in your system, not to a default value. This forces the core
Signature · 1 line
2.34.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 10 lines · Yury Norov

In current form, FORCE_NR_CPUS is visible to all users building their kernels, even not experts. It is also set in allmodconfig or allyesconfig, which is not a correct behavior.

This patch fixes it. It also changes the parameter short description:
removes implementation details and highlights the effect of the change.

Quoted 23 lines

---
v3: instead of 'choice', use !COMPILE_TEST to disable FORCE_NR_CPUS
in all{yes,mod}config, as suggested by Linus.

 lib/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/Kconfig +2 -3
index 9bbf8a4b2108..404647cd3fac 100644
@@ -529,8 +529,8 @@ config CPUMASK_OFFSTACK
        stack overflow.
 
 config FORCE_NR_CPUS
-       bool "NR_CPUS is set to an actual number of CPUs"
-       depends on SMP
+       bool "Set number of CPUs at compile time"
+       depends on SMP && EXPERT && !COMPILE_TEST
        help
          Say Yes if you have NR_CPUS set to an actual number of possible
          CPUs in your system, not to a default value. This forces the core
--

2.34.1