Skip to contentSkip to conversation

media: rc: reduce useless padding in struct rc_dev etc

PATCH New Sean Young 1 participant 1 message Feb 26, 2025

Subsystems (2)
lore
Share & tools
lore

Sean Young

author maintainer
#0 lore raw

PATCH v2 1/1 media: rc: reduce useless padding in struct rc_dev etc

Reorder the fields in these structs so that we waste less space due to padding. pahole shows that lirc_fh is 8 bytes smaller, and rc_dev is 32 bytes smaller.

---
 drivers/media/rc/rc-core-priv.h |  4 +--
 include/media/rc-core.h         | 46 ++++++++++++++++-----------------
 2 files changed, 25 insertions(+), 25 deletions(-)
drivers/media/rc/rc-core-priv.h +2 -2
index 7df949fc65e2b..4967d87ec4b77 100644
@@ -85,8 +85,8 @@ struct ir_raw_event_ctrl {
 	struct rc6_dec {
 		int state;
 		u8 header;
-		u32 body;
 		bool toggle;
+		u32 body;
 		unsigned count;
 		unsigned wanted_bits;
 	} rc6;
@@ -127,8 +127,8 @@ struct ir_raw_event_ctrl {
 	struct mce_kbd_dec {
 		/* locks key up timer */
 		spinlock_t keylock;
-		struct timer_list rx_timeout;
 		int state;
+		struct timer_list rx_timeout;
 		u8 header;
 		u32 body;
 		unsigned count;
include/media/rc-core.h +23 -23

131 lines not on this page · raw message

Signature · 1 line
2.48.1