Skip to contentSkip to conversation

cpufreq: clean up dead dependencies on X86 in Kconfig

PATCH Applied Julian Braha 3 participants 3 messages Apr 17 – May 22 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: clean up dead dependencies on X86 in Kconfig

The Kconfig in the parent directory already has an 'if X86' condition wrapping the inclusion of this file, meaning that each of the individual 'depends on' statements in this file is a duplicate dependency (dead code).

I propose leaving the outer 'if X86...endif' and removing the individual 'depends on X86' statement from each option.

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

---
 drivers/cpufreq/Kconfig.x86 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/cpufreq/Kconfig.x86 +2 -3
index 027e6ea2e038..9afceb1143df 100644
@@ -5,7 +5,6 @@
 
 config X86_INTEL_PSTATE
 	bool "Intel P state control"
-	depends on X86
 	select ACPI_PROCESSOR if ACPI
 	select ACPI_CPPC_LIB if X86_64 && ACPI && SCHED_MC_PRIO
 	select CPU_FREQ_GOV_PERFORMANCE
@@ -36,7 +35,7 @@ config X86_PCC_CPUFREQ
 
 config X86_AMD_PSTATE
 	bool "AMD Processor P-State driver"
-	depends on X86 && ACPI
+	depends on ACPI
 	select ACPI_PROCESSOR
 	select ACPI_CPPC_LIB if X86_64
 	select CPU_FREQ_GOV_SCHEDUTIL if SMP
@@ -84,7 +83,7 @@ config X86_AMD_PSTATE_DYNAMIC_EPP
 
 config X86_AMD_PSTATE_UT
 	tristate "selftest for AMD Processor P-State driver"
-	depends on X86 && ACPI_PROCESSOR
+	depends on ACPI_PROCESSOR
 	depends on X86_AMD_PSTATE
 	default n
 	help
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Julian Braha

The Kconfig in the parent directory already has an 'if X86' condition wrapping the inclusion of this file, meaning that each of the individual 'depends on' statements in this file is a duplicate dependency (dead code).

I propose leaving the outer 'if X86...endif' and removing the individual 'depends on X86' statement from each option.

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

Quoted 34 lines
---
  drivers/cpufreq/Kconfig.x86 | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/cpufreq/Kconfig.x86 +2 -3
index 027e6ea2e038..9afceb1143df 100644
@@ -5,7 +5,6 @@
 
  config X86_INTEL_PSTATE
  	bool "Intel P state control"
-	depends on X86
  	select ACPI_PROCESSOR if ACPI
  	select ACPI_CPPC_LIB if X86_64 && ACPI && SCHED_MC_PRIO
  	select CPU_FREQ_GOV_PERFORMANCE
@@ -36,7 +35,7 @@ config X86_PCC_CPUFREQ
 
  config X86_AMD_PSTATE
  	bool "AMD Processor P-State driver"
-	depends on X86 && ACPI
+	depends on ACPI
  	select ACPI_PROCESSOR
  	select ACPI_CPPC_LIB if X86_64
  	select CPU_FREQ_GOV_SCHEDUTIL if SMP
@@ -84,7 +83,7 @@ config X86_AMD_PSTATE_DYNAMIC_EPP
 
  config X86_AMD_PSTATE_UT
  	tristate "selftest for AMD Processor P-State driver"
-	depends on X86 && ACPI_PROCESSOR
+	depends on ACPI_PROCESSOR
  	depends on X86_AMD_PSTATE
  	default n
  	help
maintainer Applied
#2 lore raw
Quoted 41 lines · Mario Limonciello
Quoted 11 lines · Julian Braha

The Kconfig in the parent directory already has an 'if X86' condition wrapping the inclusion of this file, meaning that each of the individual 'depends on' statements in this file is a duplicate dependency (dead code).

I propose leaving the outer 'if X86...endif' and removing the individual 'depends on X86' statement from each option.

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

Quoted 27 lines
---
  drivers/cpufreq/Kconfig.x86 | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/cpufreq/Kconfig.x86 +1 -2
index 027e6ea2e038..9afceb1143df 100644
@@ -5,7 +5,6 @@
 
  config X86_INTEL_PSTATE
      bool "Intel P state control"
-     depends on X86
      select ACPI_PROCESSOR if ACPI
      select ACPI_CPPC_LIB if X86_64 && ACPI && SCHED_MC_PRIO
      select CPU_FREQ_GOV_PERFORMANCE
@@ -36,7 +35,7 @@ config X86_PCC_CPUFREQ
 
  config X86_AMD_PSTATE
      bool "AMD Processor P-State driver"
-     depends on X86 && ACPI
+     depends on ACPI
      select ACPI_PROCESSOR
      select ACPI_CPPC_LIB if X86_64
      select CPU_FREQ_GOV_SCHEDUTIL if SMP
@@ -84,7 +83,7 @@ config X86_AMD_PSTATE_DYNAMIC_EPP
 
Quoted 7 lines

drivers/cpufreq/Kconfig.x86 config X86_AMD_PSTATE_DYNAMIC_EPP · line 89

Quoted 7 lines
drivers/cpufreq/Kconfig.x86 +1 -1
  config X86_AMD_PSTATE_UT
      tristate "selftest for AMD Processor P-State driver"
-     depends on X86 && ACPI_PROCESSOR
+     depends on ACPI_PROCESSOR
      depends on X86_AMD_PSTATE
      default n
      help

Applied as 7.2 material, thanks!