diff mbox series

cpufreq: make cpufreq_boost_enabled return bool

Message ID 20240626084354.1762483-1-d-gole@ti.com (mailing list archive)
State Superseded, archived
Headers show
Series cpufreq: make cpufreq_boost_enabled return bool | expand

Commit Message

Dhruva Gole June 26, 2024, 8:43 a.m. UTC
Since this function is supposed to return boost_enabled which is anyway
a bool type make sure that it's return value is also marked as bool.
This helps maintain better consistency in data types being used.

Signed-off-by: Dhruva Gole <d-gole@ti.com>
---

No functional changes, just noticed this as I was reviewing the patch,
"cpufreq: Allow drivers to advertise boost enabled"

 drivers/cpufreq/cpufreq.c | 2 +-
 include/linux/cpufreq.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


base-commit: 0fc4bfab2cd45f9acb86c4f04b5191e114e901ed

Comments

Mario Limonciello June 26, 2024, 6:40 p.m. UTC | #1
On 6/26/2024 03:43, Dhruva Gole wrote:
> Since this function is supposed to return boost_enabled which is anyway
> a bool type make sure that it's return value is also marked as bool.
> This helps maintain better consistency in data types being used.
> 
> Signed-off-by: Dhruva Gole <d-gole@ti.com>
> ---
> 
> No functional changes, just noticed this as I was reviewing the patch,
> "cpufreq: Allow drivers to advertise boost enabled"
> 
>   drivers/cpufreq/cpufreq.c | 2 +-
>   include/linux/cpufreq.h   | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index e678ea7b0891..5704036f294a 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2874,7 +2874,7 @@ int cpufreq_enable_boost_support(void)
>   }
>   EXPORT_SYMBOL_GPL(cpufreq_enable_boost_support);
>   
> -int cpufreq_boost_enabled(void)
> +bool cpufreq_boost_enabled(void)
>   {
>   	return cpufreq_driver->boost_enabled;
>   }
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 20f7e98ee8af..523f81b7e2aa 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -785,7 +785,7 @@ ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
>   
>   #ifdef CONFIG_CPU_FREQ
>   int cpufreq_boost_trigger_state(int state);
> -int cpufreq_boost_enabled(void);
> +bool cpufreq_boost_enabled(void);
>   int cpufreq_enable_boost_support(void);
>   bool policy_has_boost_freq(struct cpufreq_policy *policy);
>   
> @@ -1164,7 +1164,7 @@ static inline int cpufreq_boost_trigger_state(int state)
>   {
>   	return 0;
>   }
> -static inline int cpufreq_boost_enabled(void)
> +static inline bool cpufreq_boost_enabled(void)
>   {
>   	return 0;

If making the change to the function, I think you may as well also 
change this to "false".

>   }
> 
> base-commit: 0fc4bfab2cd45f9acb86c4f04b5191e114e901ed
diff mbox series

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index e678ea7b0891..5704036f294a 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2874,7 +2874,7 @@  int cpufreq_enable_boost_support(void)
 }
 EXPORT_SYMBOL_GPL(cpufreq_enable_boost_support);
 
-int cpufreq_boost_enabled(void)
+bool cpufreq_boost_enabled(void)
 {
 	return cpufreq_driver->boost_enabled;
 }
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 20f7e98ee8af..523f81b7e2aa 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -785,7 +785,7 @@  ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
 
 #ifdef CONFIG_CPU_FREQ
 int cpufreq_boost_trigger_state(int state);
-int cpufreq_boost_enabled(void);
+bool cpufreq_boost_enabled(void);
 int cpufreq_enable_boost_support(void);
 bool policy_has_boost_freq(struct cpufreq_policy *policy);
 
@@ -1164,7 +1164,7 @@  static inline int cpufreq_boost_trigger_state(int state)
 {
 	return 0;
 }
-static inline int cpufreq_boost_enabled(void)
+static inline bool cpufreq_boost_enabled(void)
 {
 	return 0;
 }