Skip to contentSkip to conversation

cpuidle: use BIT() for idle state flags and remove CPUIDLE_DRIVER_FLAGS_MASK

PATCH In review Yangtao Li 2 participants 2 messages Jan 15, 2019 – Jan 24, 2019 CPU idle time management framework

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 cpuidle: use BIT() for idle state flags and remove CPUIDLE_DRIVER_FLAGS_MASK

Use BIT() macro to do a small tidy-up. The CPUIDLE_DRIVER_FLAGS_MASK
is not being used, so remove it.

---
 include/linux/cpuidle.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
include/linux/cpuidle.h +3 -5
index 4dff74f48d4b..3b39472324a3 100644
@@ -69,11 +69,9 @@ struct cpuidle_state {
 
 /* Idle State Flags */
 #define CPUIDLE_FLAG_NONE       (0x00)
-#define CPUIDLE_FLAG_POLLING	(0x01) /* polling state */
-#define CPUIDLE_FLAG_COUPLED	(0x02) /* state applies to multiple cpus */
-#define CPUIDLE_FLAG_TIMER_STOP (0x04)  /* timer is stopped on this state */
-
-#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
+#define CPUIDLE_FLAG_POLLING	BIT(0) /* polling state */
+#define CPUIDLE_FLAG_COUPLED	BIT(1) /* state applies to multiple cpus */
+#define CPUIDLE_FLAG_TIMER_STOP BIT(2) /* timer is stopped on this state */
 
 struct cpuidle_device_kobj;
 struct cpuidle_state_kobj;
Signature · 1 line
2.17.0
#1 lore raw
Quoted 18 lines · CET Yangtao Li

Use BIT() macro to do a small tidy-up. The CPUIDLE_DRIVER_FLAGS_MASK
is not being used, so remove it.

---
 include/linux/cpuidle.h | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
include/linux/cpuidle.h +0 -1
index 4dff74f48d4b..3b39472324a3 100644
@@ -69,11 +69,9 @@ struct cpuidle_state {
 
 /* Idle State Flags */
 #define CPUIDLE_FLAG_NONE       (0x00)
-#define CPUIDLE_FLAG_POLLING	(0x01) /* polling state */

include/linux/cpuidle.h struct cpuidle_state { · line 77

Quoted 10 lines
include/linux/cpuidle.h +3 -4
-#define CPUIDLE_FLAG_COUPLED	(0x02) /* state applies to multiple cpus */
-#define CPUIDLE_FLAG_TIMER_STOP (0x04)  /* timer is stopped on this state */
-
-#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
+#define CPUIDLE_FLAG_POLLING	BIT(0) /* polling state */
+#define CPUIDLE_FLAG_COUPLED	BIT(1) /* state applies to multiple cpus */
+#define CPUIDLE_FLAG_TIMER_STOP BIT(2) /* timer is stopped on this state */
 
 struct cpuidle_device_kobj;
 struct cpuidle_state_kobj;

Applied, even though I'm not a big fan of conversions from open-coded values (as long as they are correct) to BIT(), unless you are going to add a new flag and want to use BIT() for that, because that doesn't really matter and only makes the lives of 'git blame' users harder.

However, in this particular case, the removal of the unused symbol is legitimate IMO.