diff mbox series

[1/3] cpufreq: Move to_gov_attr_set() to cpufreq.h

Message ID 20220123124508.463305-1-haokexin@gmail.com
State Accepted
Commit ae26508651272695a3ab353f75ab9a8daf3da324
Headers show
Series [1/3] cpufreq: Move to_gov_attr_set() to cpufreq.h | expand

Commit Message

Kevin Hao Jan. 23, 2022, 12:45 p.m. UTC
So it can be reused by other codes.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
 drivers/cpufreq/cpufreq_governor_attr_set.c | 5 -----
 include/linux/cpufreq.h                     | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Rafael J. Wysocki Feb. 4, 2022, 6:25 p.m. UTC | #1
On Sun, Jan 23, 2022 at 1:49 PM Kevin Hao <haokexin@gmail.com> wrote:
>
> So it can be reused by other codes.
>
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
>  drivers/cpufreq/cpufreq_governor_attr_set.c | 5 -----
>  include/linux/cpufreq.h                     | 5 +++++
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq_governor_attr_set.c b/drivers/cpufreq/cpufreq_governor_attr_set.c
> index a6f365b9cc1a..771770ea0ed0 100644
> --- a/drivers/cpufreq/cpufreq_governor_attr_set.c
> +++ b/drivers/cpufreq/cpufreq_governor_attr_set.c
> @@ -8,11 +8,6 @@
>
>  #include "cpufreq_governor.h"
>
> -static inline struct gov_attr_set *to_gov_attr_set(struct kobject *kobj)
> -{
> -       return container_of(kobj, struct gov_attr_set, kobj);
> -}
> -
>  static inline struct governor_attr *to_gov_attr(struct attribute *attr)
>  {
>         return container_of(attr, struct governor_attr, attr);
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 1ab29e61b078..f0dfc0b260ec 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -658,6 +658,11 @@ struct gov_attr_set {
>  /* sysfs ops for cpufreq governors */
>  extern const struct sysfs_ops governor_sysfs_ops;
>
> +static inline struct gov_attr_set *to_gov_attr_set(struct kobject *kobj)
> +{
> +       return container_of(kobj, struct gov_attr_set, kobj);
> +}
> +
>  void gov_attr_set_init(struct gov_attr_set *attr_set, struct list_head *list_node);
>  void gov_attr_set_get(struct gov_attr_set *attr_set, struct list_head *list_node);
>  unsigned int gov_attr_set_put(struct gov_attr_set *attr_set, struct list_head *list_node);
> --

This one and the [2/3] have been applied as 5.18 material.

I've replied to the [3/3] directly.

Thanks!
diff mbox series

Patch

diff --git a/drivers/cpufreq/cpufreq_governor_attr_set.c b/drivers/cpufreq/cpufreq_governor_attr_set.c
index a6f365b9cc1a..771770ea0ed0 100644
--- a/drivers/cpufreq/cpufreq_governor_attr_set.c
+++ b/drivers/cpufreq/cpufreq_governor_attr_set.c
@@ -8,11 +8,6 @@ 
 
 #include "cpufreq_governor.h"
 
-static inline struct gov_attr_set *to_gov_attr_set(struct kobject *kobj)
-{
-	return container_of(kobj, struct gov_attr_set, kobj);
-}
-
 static inline struct governor_attr *to_gov_attr(struct attribute *attr)
 {
 	return container_of(attr, struct governor_attr, attr);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 1ab29e61b078..f0dfc0b260ec 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -658,6 +658,11 @@  struct gov_attr_set {
 /* sysfs ops for cpufreq governors */
 extern const struct sysfs_ops governor_sysfs_ops;
 
+static inline struct gov_attr_set *to_gov_attr_set(struct kobject *kobj)
+{
+	return container_of(kobj, struct gov_attr_set, kobj);
+}
+
 void gov_attr_set_init(struct gov_attr_set *attr_set, struct list_head *list_node);
 void gov_attr_set_get(struct gov_attr_set *attr_set, struct list_head *list_node);
 unsigned int gov_attr_set_put(struct gov_attr_set *attr_set, struct list_head *list_node);