[RFC v8 21/28] clockevents: pack ->state_use_accessors and ->features together

From: Nicolai Stange
Date: Sat Nov 19 2016 - 11:12:10 EST


Right now, the members ->state_use_accessors and ->features of
struct clock_event_device occupy an int each which is way more than needed:
the former can only take one of the five different values from
enum clock_event_state while the latter is a bitmask with the highest
CLOCK_EVT_FEAT_* bit defined so far being the ninth.

Both members are located in the first cacheline and thus, packing them into
a single int would free some precious space there.

Turn both members into appropriately sized bitfields.

Signed-off-by: Nicolai Stange <nicstange@xxxxxxxxx>
---
include/linux/clockchips.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index c8dfc7a..548f4fe 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -111,8 +111,8 @@ struct clock_event_device {
unsigned int min_delta_ticks_adjusted;
u32 mult;
u32 shift;
- enum clock_event_state state_use_accessors;
- unsigned int features;
+ enum clock_event_state state_use_accessors:8;
+ unsigned int features:24;
unsigned long retries;

int (*set_state_periodic)(struct clock_event_device *);
--
2.10.2