diff mbox series

[2/3] i2c: xiic: Improve struct memory alignment

Message ID 20200827144848.12107-3-ext-jaakko.laine@vaisala.com
State Accepted
Commit 9106e45ceaafd3c3a7264c68dc5dc08874f6c8ce
Headers show
Series [1/3] i2c: xiic: Change code alignment to 1 space only | expand

Commit Message

Jaakko Laine Aug. 27, 2020, 2:48 p.m. UTC
From: Jaakko Laine <ext-jaakko.laine@vaisala.com>

xiic_i2c struct alignment causes the struct to
take more space in memory than strictly required.
Move state -member to end of struct to get less
padding.

Signed-off-by: Jaakko Laine <ext-jaakko.laine@vaisala.com>
Suggested-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/i2c/busses/i2c-xiic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 10380531d45c..1453d82bb664 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -54,11 +54,11 @@  enum xiic_endian {
  * @lock: Mutual exclusion
  * @tx_pos: Current pos in TX message
  * @nmsgs: Number of messages in tx_msg
- * @state: See STATE_
  * @rx_msg: Current RX message
  * @rx_pos: Position within current RX message
  * @endianness: big/little-endian byte order
  * @clk: Pointer to AXI4-lite input clock
+ * @state: See STATE_
  */
 struct xiic_i2c {
 	struct device *dev;
@@ -69,11 +69,11 @@  struct xiic_i2c {
 	struct mutex lock;
 	unsigned int tx_pos;
 	unsigned int nmsgs;
-	enum xilinx_i2c_state state;
 	struct i2c_msg *rx_msg;
 	int rx_pos;
 	enum xiic_endian endianness;
 	struct clk *clk;
+	enum xilinx_i2c_state state;
 };