Skip to contentSkip to conversation

cpuidle: sysfs: Remove the unused define_one_r(o/w) macros

PATCH Applied Hanjun Guo 2 participants 3 messages Apr 27, 2020 – Apr 29, 2020 CPU idle time management framework

lore
Share & tools
lore

Hanjun Guo

author
#0 lore raw

PATCH 1/2 cpuidle: sysfs: Remove the unused define_one_r(o/w) macros

The define_one_ro and define_one_rw macros are not used, remove it.

---
 drivers/cpuidle/sysfs.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/cpuidle/sysfs.c +0 -5
index cdeedbf..7729cf6 100644
@@ -167,11 +167,6 @@ struct cpuidle_attr {
 	ssize_t (*store)(struct cpuidle_device *, const char *, size_t count);
 };
 
-#define define_one_ro(_name, show) \
-	static struct cpuidle_attr attr_##_name = __ATTR(_name, 0444, show, NULL)
-#define define_one_rw(_name, show, store) \
-	static struct cpuidle_attr attr_##_name = __ATTR(_name, 0644, show, store)
-
 #define attr_to_cpuidleattr(a) container_of(a, struct cpuidle_attr, attr)
 
 struct cpuidle_device_kobj {
Signature · 1 line
1.7.12.4
author
#1 lore raw

PATCH 2/2 cpuidle: sysfs: Minor coding style correction

Fix two minor coding style issues.

---
 drivers/cpuidle/sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpuidle/sysfs.c +2 -2
index 7729cf6..d3ef1d7 100644
@@ -426,12 +426,12 @@ static inline void cpuidle_remove_s2idle_attr_group(struct cpuidle_state_kobj *k
 #define attr_to_stateattr(a) container_of(a, struct cpuidle_state_attr, attr)
 
 static ssize_t cpuidle_state_show(struct kobject *kobj, struct attribute *attr,
-				  char * buf)
+				  char *buf)
 {
 	int ret = -EIO;
 	struct cpuidle_state *state = kobj_to_state(kobj);
 	struct cpuidle_state_usage *state_usage = kobj_to_state_usage(kobj);
-	struct cpuidle_state_attr * cattr = attr_to_stateattr(attr);
+	struct cpuidle_state_attr *cattr = attr_to_stateattr(attr);
 
 	if (cattr->show)
 		ret = cattr->show(state, state_usage, buf);
Signature · 1 line
1.7.12.4
maintainer Applied
#2 lore raw
In reply to Hanjun Guo
Quoted 16 lines · Hanjun Guo

The define_one_ro and define_one_rw macros are not used, remove it.

---
 drivers/cpuidle/sysfs.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/cpuidle/sysfs.c +0 -0
index cdeedbf..7729cf6 100644
@@ -167,11 +167,6 @@ struct cpuidle_attr {
        ssize_t (*store)(struct cpuidle_device *, const char *, size_t count);
 };

drivers/cpuidle/sysfs.c struct cpuidle_attr {

Quoted 10 lines
drivers/cpuidle/sysfs.c +0 -6
 
-#define define_one_ro(_name, show) \
-       static struct cpuidle_attr attr_##_name = __ATTR(_name, 0444, show, NULL)
-#define define_one_rw(_name, show, store) \
-       static struct cpuidle_attr attr_##_name = __ATTR(_name, 0644, show, store)
-
 #define attr_to_cpuidleattr(a) container_of(a, struct cpuidle_attr, attr)
 
 struct cpuidle_device_kobj {
--

Applied as 5.8 material along with the [2/2], thanks!