[PATCH] nohz: replace dead select with choice default

From: Julian Braha

Date: Sat Aug 01 2026 - 12:02:03 EST


'select' does not work on config options in a 'choice', so currently the
'select VIRT_CPU_ACCOUNTING_GEN' for NO_HZ_FULL is dead, with the choice
option VIRT_CPU_ACCOUNTING_GEN only being enabled when NO_HZ_FULL=y because
the other choice members depend on NO_HZ_FULL=n.

Let's remove the dead select, and encode this relationship as a default of
the choice, instead.

This dead select was found by kconfirm, a static analysis tool for Kconfig.

Signed-off-by: Julian Braha <julianbraha@xxxxxxxxx>
---
init/Kconfig | 1 +
kernel/time/Kconfig | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index 544167a7045d..8583d9f06c52 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -565,6 +565,7 @@ config VIRT_CPU_ACCOUNTING

choice
prompt "Cputime accounting"
+ default VIRT_CPU_ACCOUNTING_GEN if NO_HZ_FULL
default TICK_CPU_ACCOUNTING

# Kind of a stub config for the pure tick based cputime accounting
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index d098ac39bde4..ddfb6bee0745 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -133,7 +133,6 @@ config NO_HZ_FULL
depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
select NO_HZ_COMMON
select RCU_NOCB_CPU
- select VIRT_CPU_ACCOUNTING_GEN
select IRQ_WORK
select CPU_ISOLATION
help
--
2.55.0