diff mbox series

[V2] cpufreq: make cpufreq_boost_enabled return bool

Message ID 20240627060117.1809477-1-d-gole@ti.com (mailing list archive)
State Queued
Delegated to: Rafael Wysocki
Headers show
Series [V2] cpufreq: make cpufreq_boost_enabled return bool | expand

Commit Message

Dhruva Gole June 27, 2024, 6:01 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>
---

Changelog:
"return false" instead of 0 as per Mario's suggestion.

Link to previous patch:
https://lore.kernel.org/linux-pm/20240626084354.1762483-1-d-gole@ti.com/

---

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


base-commit: df9574a57d02b265322e77fb8628d4d33641dda9

Comments

Mario Limonciello June 27, 2024, 6:57 p.m. UTC | #1
On 6/27/2024 01:01, 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>

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

> ---
> 
> Changelog:
> "return false" instead of 0 as per Mario's suggestion.
> 
> Link to previous patch:
> https://lore.kernel.org/linux-pm/20240626084354.1762483-1-d-gole@ti.com/
> 
> ---
> 
>   drivers/cpufreq/cpufreq.c | 2 +-
>   include/linux/cpufreq.h   | 6 +++---
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 82c500389a40..709e7b1f9826 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2873,7 +2873,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..6f57de7de433 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,9 +1164,9 @@ 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;
> +	return false;
>   }
>   
>   static inline int cpufreq_enable_boost_support(void)
> 
> base-commit: df9574a57d02b265322e77fb8628d4d33641dda9
Rafael J. Wysocki June 28, 2024, 6:59 p.m. UTC | #2
On Thu, Jun 27, 2024 at 8:57 PM Mario Limonciello
<mario.limonciello@amd.com> wrote:
>
> On 6/27/2024 01:01, 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>
>
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

Applied as 6.11 material, thanks!

> > ---
> >
> > Changelog:
> > "return false" instead of 0 as per Mario's suggestion.
> >
> > Link to previous patch:
> > https://lore.kernel.org/linux-pm/20240626084354.1762483-1-d-gole@ti.com/
> >
> > ---
> >
> >   drivers/cpufreq/cpufreq.c | 2 +-
> >   include/linux/cpufreq.h   | 6 +++---
> >   2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index 82c500389a40..709e7b1f9826 100644
> > --- a/drivers/cpufreq/cpufreq.c
> > +++ b/drivers/cpufreq/cpufreq.c
> > @@ -2873,7 +2873,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..6f57de7de433 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,9 +1164,9 @@ 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;
> > +     return false;
> >   }
> >
> >   static inline int cpufreq_enable_boost_support(void)
> >
> > base-commit: df9574a57d02b265322e77fb8628d4d33641dda9
>
>
diff mbox series

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 82c500389a40..709e7b1f9826 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2873,7 +2873,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..6f57de7de433 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,9 +1164,9 @@  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;
+	return false;
 }
 
 static inline int cpufreq_enable_boost_support(void)