diff mbox series

cpufreq: intel_pstate: Fix compilation for !CONFIG_ACPI

Message ID 20181023185429.GA6756@light.dominikbrodowski.net (mailing list archive)
State Superseded, archived
Headers show
Series cpufreq: intel_pstate: Fix compilation for !CONFIG_ACPI | expand

Commit Message

Dominik Brodowski Oct. 23, 2018, 6:54 p.m. UTC
Fixes: 86d333a8cc7f ("cpufreq: intel_pstate: Add base_frequency attribute")
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

Comments

srinivas pandruvada Oct. 23, 2018, 7:17 p.m. UTC | #1
On Tue, 2018-10-23 at 20:54 +0200, Dominik Brodowski wrote:
> Fixes: 86d333a8cc7f ("cpufreq: intel_pstate: Add base_frequency
> attribute")
Thanks for the fix.

> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Cc: Len Brown <lenb@kernel.org>
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> 
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index 49c0abf2d48f..50c5699970c5 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -390,11 +390,6 @@ static int intel_pstate_get_cppc_guranteed(int
> cpu)
>  static void intel_pstate_set_itmt_prio(int cpu)
>  {
>  }
> -
> -static int intel_pstate_get_cppc_guranteed(int cpu)
> -{
> -	return -ENOTSUPP;
> -}
What is ACPI is defined but SCHED_MC_PRIO is not defined?
Based on
"select ACPI_CPPC_LIB if X86_64 && ACPI && SCHED_MC_PRIO"

So the above is still required. correct?

>  #endif
>  
>  static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy
> *policy)
> @@ -490,6 +485,11 @@ static inline bool
> intel_pstate_acpi_pm_profile_server(void)
>  {
>  	return false;
>  }
> +
> +static int intel_pstate_get_cppc_guranteed(int cpu)
> +{
> +	return -ENOTSUPP;
> +}
>  #endif
>  
>  static inline void update_turbo_state(void)
Dominik Brodowski Oct. 23, 2018, 7:34 p.m. UTC | #2
On Tue, Oct 23, 2018 at 12:17:28PM -0700, Srinivas Pandruvada wrote:
> On Tue, 2018-10-23 at 20:54 +0200, Dominik Brodowski wrote:
> > Fixes: 86d333a8cc7f ("cpufreq: intel_pstate: Add base_frequency
> > attribute")
> Thanks for the fix.
> 
> > Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Cc: Len Brown <lenb@kernel.org>
> > Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> > 
> > diff --git a/drivers/cpufreq/intel_pstate.c
> > b/drivers/cpufreq/intel_pstate.c
> > index 49c0abf2d48f..50c5699970c5 100644
> > --- a/drivers/cpufreq/intel_pstate.c
> > +++ b/drivers/cpufreq/intel_pstate.c
> > @@ -390,11 +390,6 @@ static int intel_pstate_get_cppc_guranteed(int
> > cpu)
> >  static void intel_pstate_set_itmt_prio(int cpu)
> >  {
> >  }
> > -
> > -static int intel_pstate_get_cppc_guranteed(int cpu)
> > -{
> > -	return -ENOTSUPP;
> > -}
> What is ACPI is defined but SCHED_MC_PRIO is not defined?
> Based on
> "select ACPI_CPPC_LIB if X86_64 && ACPI && SCHED_MC_PRIO"
> 
> So the above is still required. correct?

Seems so, yes. Though that leads to either complicated #ifdefs or code
duplications.

In any case, I'd suggest marking at least nested #else and #endif lines
with comments denoting which #ifdef they relate to, e.g.

	#else	/* CONFIG_ACPI */
	#endif	/* CONFIG_ACPI */

Thanks,
	Dominik
srinivas pandruvada Oct. 23, 2018, 7:36 p.m. UTC | #3
On Tue, 2018-10-23 at 21:34 +0200, Dominik Brodowski wrote:
> On Tue, Oct 23, 2018 at 12:17:28PM -0700, Srinivas Pandruvada wrote:
> > On Tue, 2018-10-23 at 20:54 +0200, Dominik Brodowski wrote:
> > > Fixes: 86d333a8cc7f ("cpufreq: intel_pstate: Add base_frequency
> > > attribute")
> > 
> > Thanks for the fix.
> > 
> > > Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > > Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > Cc: Len Brown <lenb@kernel.org>
> > > Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> > > 
> > > diff --git a/drivers/cpufreq/intel_pstate.c
> > > b/drivers/cpufreq/intel_pstate.c
> > > index 49c0abf2d48f..50c5699970c5 100644
> > > --- a/drivers/cpufreq/intel_pstate.c
> > > +++ b/drivers/cpufreq/intel_pstate.c
> > > @@ -390,11 +390,6 @@ static int
> > > intel_pstate_get_cppc_guranteed(int
> > > cpu)
> > >  static void intel_pstate_set_itmt_prio(int cpu)
> > >  {
> > >  }
> > > -
> > > -static int intel_pstate_get_cppc_guranteed(int cpu)
> > > -{
> > > -	return -ENOTSUPP;
> > > -}
> > 
> > What is ACPI is defined but SCHED_MC_PRIO is not defined?
> > Based on
> > "select ACPI_CPPC_LIB if X86_64 && ACPI && SCHED_MC_PRIO"
> > 
> > So the above is still required. correct?
> 
> Seems so, yes. Though that leads to either complicated #ifdefs or
> code
> duplications.
> 
> In any case, I'd suggest marking at least nested #else and #endif
> lines
> with comments denoting which #ifdef they relate to, e.g.
> 
> 	#else	/* CONFIG_ACPI */
> 	#endif	/* CONFIG_ACPI */
Will you submit a change?

Thanks,
Srinivas

> 
> Thanks,
> 	Dominik
diff mbox series

Patch

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 49c0abf2d48f..50c5699970c5 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -390,11 +390,6 @@  static int intel_pstate_get_cppc_guranteed(int cpu)
 static void intel_pstate_set_itmt_prio(int cpu)
 {
 }
-
-static int intel_pstate_get_cppc_guranteed(int cpu)
-{
-	return -ENOTSUPP;
-}
 #endif
 
 static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy)
@@ -490,6 +485,11 @@  static inline bool intel_pstate_acpi_pm_profile_server(void)
 {
 	return false;
 }
+
+static int intel_pstate_get_cppc_guranteed(int cpu)
+{
+	return -ENOTSUPP;
+}
 #endif
 
 static inline void update_turbo_state(void)