Skip to contentSkip to conversation

regmap: rbtree: improve 64bits memory alignment

PATCH Applied David Cohen 2 participants 2 messages Apr 1, 2014 – Apr 2, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regmap: rbtree: improve 64bits memory alignment

From: Jean-Christophe PINCE <[email protected]>

Change regcache_rbtree_node strcuture fields order to align the pointers on 64bits architectures.

---
 drivers/base/regmap/regcache-rbtree.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/base/regmap/regcache-rbtree.c +4 -4
index 930cad4e5df8..6a7e4fa12854 100644
@@ -23,16 +23,16 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
 static int regcache_rbtree_exit(struct regmap *map);
 
 struct regcache_rbtree_node {
-	/* the actual rbtree node holding this block */
-	struct rb_node node;
-	/* base register handled by this block */
-	unsigned int base_reg;
 	/* block of adjacent registers */
 	void *block;
 	/* Which registers are present */
 	long *cache_present;
+	/* base register handled by this block */
+	unsigned int base_reg;
 	/* number of registers available in the block */
 	unsigned int blklen;
+	/* the actual rbtree node holding this block */
+	struct rb_node node;
 } __attribute__ ((packed));
 
 struct regcache_rbtree_ctx {
Signature · 1 line
1.9.0
maintainer Applied
#1 lore raw
Quoted 4 lines · David Cohen

From: Jean-Christophe PINCE <[email protected]>

Change regcache_rbtree_node strcuture fields order to align the pointers on 64bits architectures.

Applied, thanks. It seems like this is something there should be some sort of tool for - it doesn't obviously fit into any of the existing ones though.