From: Kevin Hao <haokexin@gmail.com>
To: linux-pm@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH 1/3] cpufreq: Move to_gov_attr_set() to cpufreq.h
Date: Sun, 23 Jan 2022 20:45:06 +0800 [thread overview]
Message-ID: <20220123124508.463305-1-haokexin@gmail.com> (raw)
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);
--
2.31.1
next reply other threads:[~2022-01-23 12:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-23 12:45 Kevin Hao [this message]
2022-01-23 12:45 ` [PATCH 2/3] cpufreq: schedutil: Use to_gov_attr_set() to get the gov_attr_set Kevin Hao
2022-01-23 12:45 ` [PATCH 3/3] cpufreq: governor: Use kobject release() method to free dbs_data Kevin Hao
2022-02-04 18:19 ` Rafael J. Wysocki
2022-02-05 11:01 ` Kevin Hao
2022-04-09 12:10 ` Kevin Hao
2022-04-13 13:30 ` Rafael J. Wysocki
2022-02-04 18:25 ` [PATCH 1/3] cpufreq: Move to_gov_attr_set() to cpufreq.h Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220123124508.463305-1-haokexin@gmail.com \
--to=haokexin@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox