Skip to contentSkip to conversation

cpuidle: Delete unused define_one_ro/rw macros

PATCH In review Pascal Terjan 3 participants 4 messages May 13, 2020 – May 15, 2020 CPU idle time management framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpuidle: Delete unused define_one_ro/rw macros

They were already unused when cpuidle was introduced.

---
 drivers/cpuidle/sysfs.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/cpuidle/sysfs.c +0 -5
index cdeedbf02646..7729cf622d1e 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
2.26.2.645.ge9eca65c58-goog
#1 lore raw
Quoted 15 lines · Pascal Terjan

They were already unused when cpuidle was introduced.

---
 drivers/cpuidle/sysfs.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/cpuidle/sysfs.c +0 -0
index cdeedbf02646..7729cf622d1e 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 {
--

This patch doesn't apply on top of the cpuidle material for 5.8 present in linux-next, thanks!

#2 lore raw
Quoted 25 lines · Rafael J. Wysocki
Quoted 23 lines · Pascal Terjan

They were already unused when cpuidle was introduced.

---
 drivers/cpuidle/sysfs.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/cpuidle/sysfs.c +0 -5
index cdeedbf02646..7729cf622d1e 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)
 
Quoted 5 lines

drivers/cpuidle/sysfs.c struct cpuidle_attr {

Quoted 2 lines
drivers/cpuidle/sysfs.c +0 -1
 struct cpuidle_device_kobj {
--

This patch doesn't apply on top of the cpuidle material for 5.8 present in linux-next, thanks!

Funny timing, it was actually already done a few weeks ago after all those years :)
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=2f516e7cbe88f05023b6cc458d3a22b7dc56af99

#3 lore raw
Quoted 32 lines · Pascal Terjan
Quoted 25 lines · Rafael J. Wysocki
Quoted 23 lines · Pascal Terjan

They were already unused when cpuidle was introduced.

---
  drivers/cpuidle/sysfs.c | 5 -----
  1 file changed, 5 deletions(-)
drivers/cpuidle/sysfs.c +0 -5
index cdeedbf02646..7729cf622d1e 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)
 
Quoted 5 lines

drivers/cpuidle/sysfs.c struct cpuidle_attr {

Quoted 2 lines
drivers/cpuidle/sysfs.c +0 -1
  struct cpuidle_device_kobj {
--

This patch doesn't apply on top of the cpuidle material for 5.8 present in linux-next, thanks!

Quoted 3 lines

Funny timing, it was actually already done a few weeks ago after all those years :)
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=2f516e7cbe88f05023b6cc458d3a22b7dc56af99

It is :)

I spotted it when trying to make cpudile governor switchable to be the default behaviour [0].

[0]: https://patchwork.kernel.org/cover/11519511/

Thanks
Hanjun