public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: cleanup dead code in Kconfig
@ 2026-03-31  7:42 Julian Braha
  2026-03-31  7:55 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Braha @ 2026-03-31  7:42 UTC (permalink / raw)
  To: rafael, viresh.kumar; +Cc: linux-pm, linux-kernel, Julian Braha

There is already an 'if CPU_FREQ' condition wrapping these config
options, making the 'depends on' statement for each a duplicate
dependency (dead code).

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

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

Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
 drivers/cpufreq/Kconfig | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index 78702a08364f..db83f3365698 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -163,7 +163,6 @@ config CPU_FREQ_GOV_ONDEMAND
 
 config CPU_FREQ_GOV_CONSERVATIVE
 	tristate "'conservative' cpufreq governor"
-	depends on CPU_FREQ
 	select CPU_FREQ_GOV_COMMON
 	help
 	  'conservative' - this driver is rather similar to the 'ondemand'
@@ -188,7 +187,7 @@ config CPU_FREQ_GOV_CONSERVATIVE
 
 config CPU_FREQ_GOV_SCHEDUTIL
 	bool "'schedutil' cpufreq policy governor"
-	depends on CPU_FREQ && SMP
+	depends on SMP
 	select CPU_FREQ_GOV_ATTR_SET
 	select IRQ_WORK
 	help
@@ -365,6 +364,6 @@ config ACPI_CPPC_CPUFREQ_FIE
 
 	  If in doubt, say N.
 
-endif
+endif # CPU_FREQ
 
 endmenu
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: cleanup dead code in Kconfig
  2026-03-31  7:42 [PATCH] cpufreq: cleanup dead code in Kconfig Julian Braha
@ 2026-03-31  7:55 ` Viresh Kumar
  2026-04-01 13:59   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2026-03-31  7:55 UTC (permalink / raw)
  To: Julian Braha; +Cc: rafael, linux-pm, linux-kernel

On 31-03-26, 08:42, Julian Braha wrote:
> There is already an 'if CPU_FREQ' condition wrapping these config
> options, making the 'depends on' statement for each a duplicate
> dependency (dead code).
> 
> I propose leaving the outer 'if CPU_FREQ...endif' and
> removing the individual 'depends on' statement from each option.
> 
> This dead code was found by kconfirm, a static analysis tool for Kconfig.
> 
> Signed-off-by: Julian Braha <julianbraha@gmail.com>
> ---
>  drivers/cpufreq/Kconfig | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> index 78702a08364f..db83f3365698 100644
> --- a/drivers/cpufreq/Kconfig
> +++ b/drivers/cpufreq/Kconfig
> @@ -163,7 +163,6 @@ config CPU_FREQ_GOV_ONDEMAND
>  
>  config CPU_FREQ_GOV_CONSERVATIVE
>  	tristate "'conservative' cpufreq governor"
> -	depends on CPU_FREQ
>  	select CPU_FREQ_GOV_COMMON
>  	help
>  	  'conservative' - this driver is rather similar to the 'ondemand'
> @@ -188,7 +187,7 @@ config CPU_FREQ_GOV_CONSERVATIVE
>  
>  config CPU_FREQ_GOV_SCHEDUTIL
>  	bool "'schedutil' cpufreq policy governor"
> -	depends on CPU_FREQ && SMP
> +	depends on SMP
>  	select CPU_FREQ_GOV_ATTR_SET
>  	select IRQ_WORK
>  	help
> @@ -365,6 +364,6 @@ config ACPI_CPPC_CPUFREQ_FIE
>  
>  	  If in doubt, say N.
>  
> -endif
> +endif # CPU_FREQ
>  
>  endmenu

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: cleanup dead code in Kconfig
  2026-03-31  7:55 ` Viresh Kumar
@ 2026-04-01 13:59   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2026-04-01 13:59 UTC (permalink / raw)
  To: Viresh Kumar, Julian Braha; +Cc: linux-pm, linux-kernel

On Tue, Mar 31, 2026 at 9:55 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 31-03-26, 08:42, Julian Braha wrote:
> > There is already an 'if CPU_FREQ' condition wrapping these config
> > options, making the 'depends on' statement for each a duplicate
> > dependency (dead code).
> >
> > I propose leaving the outer 'if CPU_FREQ...endif' and
> > removing the individual 'depends on' statement from each option.
> >
> > This dead code was found by kconfirm, a static analysis tool for Kconfig.
> >
> > Signed-off-by: Julian Braha <julianbraha@gmail.com>
> > ---
> >  drivers/cpufreq/Kconfig | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> > index 78702a08364f..db83f3365698 100644
> > --- a/drivers/cpufreq/Kconfig
> > +++ b/drivers/cpufreq/Kconfig
> > @@ -163,7 +163,6 @@ config CPU_FREQ_GOV_ONDEMAND
> >
> >  config CPU_FREQ_GOV_CONSERVATIVE
> >       tristate "'conservative' cpufreq governor"
> > -     depends on CPU_FREQ
> >       select CPU_FREQ_GOV_COMMON
> >       help
> >         'conservative' - this driver is rather similar to the 'ondemand'
> > @@ -188,7 +187,7 @@ config CPU_FREQ_GOV_CONSERVATIVE
> >
> >  config CPU_FREQ_GOV_SCHEDUTIL
> >       bool "'schedutil' cpufreq policy governor"
> > -     depends on CPU_FREQ && SMP
> > +     depends on SMP
> >       select CPU_FREQ_GOV_ATTR_SET
> >       select IRQ_WORK
> >       help
> > @@ -365,6 +364,6 @@ config ACPI_CPPC_CPUFREQ_FIE
> >
> >         If in doubt, say N.
> >
> > -endif
> > +endif # CPU_FREQ
> >
> >  endmenu
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Applied as 7.1 material, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-01 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31  7:42 [PATCH] cpufreq: cleanup dead code in Kconfig Julian Braha
2026-03-31  7:55 ` Viresh Kumar
2026-04-01 13:59   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox