diff mbox series

[v2] cpufreq: intel_pstate: Fix compilation for !CONFIG_ACPI

Message ID 20181023195403.GA3094@light.dominikbrodowski.net (mailing list archive)
State Mainlined
Delegated to: Rafael Wysocki
Headers show
Series [v2] cpufreq: intel_pstate: Fix compilation for !CONFIG_ACPI | expand

Commit Message

Dominik Brodowski Oct. 23, 2018, 7:54 p.m. UTC
While at it, add a few comments which config options #ifdef
and #else statements refer to.

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>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

Comments

srinivas pandruvada Oct. 23, 2018, 9:52 p.m. UTC | #1
On Tue, 2018-10-23 at 21:54 +0200, Dominik Brodowski wrote:
> While at it, add a few comments which config options #ifdef
> and #else statements refer to.
> 
> 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>
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> 
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index 49c0abf2d48f..9578312e43f2 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -386,16 +386,11 @@ static int intel_pstate_get_cppc_guranteed(int
> cpu)
>  	return cppc_perf.guaranteed_perf;
>  }
>  
> -#else
> +#else /* CONFIG_ACPI_CPPC_LIB */
>  static void intel_pstate_set_itmt_prio(int cpu)
>  {
>  }
> -
> -static int intel_pstate_get_cppc_guranteed(int cpu)
> -{
> -	return -ENOTSUPP;
> -}
> -#endif
> +#endif /* CONFIG_ACPI_CPPC_LIB */
>  
>  static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy
> *policy)
>  {
> @@ -477,7 +472,7 @@ static void intel_pstate_exit_perf_limits(struct
> cpufreq_policy *policy)
>  
>  	acpi_processor_unregister_performance(policy->cpu);
>  }
> -#else
> +#else /* CONFIG_ACPI */
>  static inline void intel_pstate_init_acpi_perf_limits(struct
> cpufreq_policy *policy)
>  {
>  }
> @@ -490,7 +485,14 @@ static inline bool
> intel_pstate_acpi_pm_profile_server(void)
>  {
>  	return false;
>  }
> -#endif
> +#endif /* CONFIG_ACPI */
> +
> +#ifndef CONFIG_ACPI_CPPC_LIB
> +static int intel_pstate_get_cppc_guranteed(int cpu)
> +{
> +	return -ENOTSUPP;
> +}
> +#endif /* CONFIG_ACPI_CPPC_LIB */
>  
>  static inline void update_turbo_state(void)
>  {
Rafael J. Wysocki Oct. 26, 2018, 9:24 a.m. UTC | #2
On Tuesday, October 23, 2018 11:52:12 PM CEST Srinivas Pandruvada wrote:
> On Tue, 2018-10-23 at 21:54 +0200, Dominik Brodowski wrote:
> > While at it, add a few comments which config options #ifdef
> > and #else statements refer to.
> > 
> > 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>
> > Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> 
> > 
> > diff --git a/drivers/cpufreq/intel_pstate.c
> > b/drivers/cpufreq/intel_pstate.c
> > index 49c0abf2d48f..9578312e43f2 100644
> > --- a/drivers/cpufreq/intel_pstate.c
> > +++ b/drivers/cpufreq/intel_pstate.c
> > @@ -386,16 +386,11 @@ static int intel_pstate_get_cppc_guranteed(int
> > cpu)
> >  	return cppc_perf.guaranteed_perf;
> >  }
> >  
> > -#else
> > +#else /* CONFIG_ACPI_CPPC_LIB */
> >  static void intel_pstate_set_itmt_prio(int cpu)
> >  {
> >  }
> > -
> > -static int intel_pstate_get_cppc_guranteed(int cpu)
> > -{
> > -	return -ENOTSUPP;
> > -}
> > -#endif
> > +#endif /* CONFIG_ACPI_CPPC_LIB */
> >  
> >  static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy
> > *policy)
> >  {
> > @@ -477,7 +472,7 @@ static void intel_pstate_exit_perf_limits(struct
> > cpufreq_policy *policy)
> >  
> >  	acpi_processor_unregister_performance(policy->cpu);
> >  }
> > -#else
> > +#else /* CONFIG_ACPI */
> >  static inline void intel_pstate_init_acpi_perf_limits(struct
> > cpufreq_policy *policy)
> >  {
> >  }
> > @@ -490,7 +485,14 @@ static inline bool
> > intel_pstate_acpi_pm_profile_server(void)
> >  {
> >  	return false;
> >  }
> > -#endif
> > +#endif /* CONFIG_ACPI */
> > +
> > +#ifndef CONFIG_ACPI_CPPC_LIB
> > +static int intel_pstate_get_cppc_guranteed(int cpu)
> > +{
> > +	return -ENOTSUPP;
> > +}
> > +#endif /* CONFIG_ACPI_CPPC_LIB */
> >  
> >  static inline void update_turbo_state(void)
> >  {
> 
> 

Patch applied, thanks!
diff mbox series

Patch

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 49c0abf2d48f..9578312e43f2 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -386,16 +386,11 @@  static int intel_pstate_get_cppc_guranteed(int cpu)
 	return cppc_perf.guaranteed_perf;
 }
 
-#else
+#else /* CONFIG_ACPI_CPPC_LIB */
 static void intel_pstate_set_itmt_prio(int cpu)
 {
 }
-
-static int intel_pstate_get_cppc_guranteed(int cpu)
-{
-	return -ENOTSUPP;
-}
-#endif
+#endif /* CONFIG_ACPI_CPPC_LIB */
 
 static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy)
 {
@@ -477,7 +472,7 @@  static void intel_pstate_exit_perf_limits(struct cpufreq_policy *policy)
 
 	acpi_processor_unregister_performance(policy->cpu);
 }
-#else
+#else /* CONFIG_ACPI */
 static inline void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy)
 {
 }
@@ -490,7 +485,14 @@  static inline bool intel_pstate_acpi_pm_profile_server(void)
 {
 	return false;
 }
-#endif
+#endif /* CONFIG_ACPI */
+
+#ifndef CONFIG_ACPI_CPPC_LIB
+static int intel_pstate_get_cppc_guranteed(int cpu)
+{
+	return -ENOTSUPP;
+}
+#endif /* CONFIG_ACPI_CPPC_LIB */
 
 static inline void update_turbo_state(void)
 {