diff mbox series

[2/3] cpufreq: update headers to use STUB_UNLESS macro

Message ID 1547827230-55132-3-git-send-email-andrew.murray@arm.com (mailing list archive)
State New, archived
Headers show
Series Abstract empty functions with STUB_UNLESS macro | expand

Commit Message

Andrew Murray Jan. 18, 2019, 4 p.m. UTC
Use the STUB_UNLESS macro to simplify function declaration.

Signed-off-by: Andrew Murray <andrew.murray@arm.com>
---
 include/linux/cpufreq.h | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

Comments

Steven Price Jan. 18, 2019, 4:29 p.m. UTC | #1
On 18/01/2019 16:00, Andrew Murray wrote:
> Use the STUB_UNLESS macro to simplify function declaration.
> 
> Signed-off-by: Andrew Murray <andrew.murray@arm.com>

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>  include/linux/cpufreq.h | 21 ++++++---------------
>  1 file changed, 6 insertions(+), 15 deletions(-)
> 
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index c86d6d8..2c53cae 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -159,21 +159,12 @@ struct cpufreq_policy {
>  #define CPUFREQ_SHARED_TYPE_ALL	 (2) /* All dependent CPUs should set freq */
>  #define CPUFREQ_SHARED_TYPE_ANY	 (3) /* Freq can be set from any dependent CPU*/
>  
> -#ifdef CONFIG_CPU_FREQ
> -struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu);
> -struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
> -void cpufreq_cpu_put(struct cpufreq_policy *policy);
> -#else
> -static inline struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)
> -{
> -	return NULL;
> -}
> -static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
> -{
> -	return NULL;
> -}
> -static inline void cpufreq_cpu_put(struct cpufreq_policy *policy) { }
> -#endif
> +STUB_UNLESS(CONFIG_CPU_FREQ, return NULL,
> +struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu));
> +STUB_UNLESS(CONFIG_CPU_FREQ, return NULL,
> +struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu));
> +STUB_UNLESS(CONFIG_CPU_FREQ,
> +void cpufreq_cpu_put(struct cpufreq_policy *policy));
>  
>  static inline bool policy_is_shared(struct cpufreq_policy *policy)
>  {
>
diff mbox series

Patch

diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c86d6d8..2c53cae 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -159,21 +159,12 @@  struct cpufreq_policy {
 #define CPUFREQ_SHARED_TYPE_ALL	 (2) /* All dependent CPUs should set freq */
 #define CPUFREQ_SHARED_TYPE_ANY	 (3) /* Freq can be set from any dependent CPU*/
 
-#ifdef CONFIG_CPU_FREQ
-struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu);
-struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
-void cpufreq_cpu_put(struct cpufreq_policy *policy);
-#else
-static inline struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu)
-{
-	return NULL;
-}
-static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
-{
-	return NULL;
-}
-static inline void cpufreq_cpu_put(struct cpufreq_policy *policy) { }
-#endif
+STUB_UNLESS(CONFIG_CPU_FREQ, return NULL,
+struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu));
+STUB_UNLESS(CONFIG_CPU_FREQ, return NULL,
+struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu));
+STUB_UNLESS(CONFIG_CPU_FREQ,
+void cpufreq_cpu_put(struct cpufreq_policy *policy));
 
 static inline bool policy_is_shared(struct cpufreq_policy *policy)
 {