regmap: Remove attribute packed from struct 'regcache_rbtree_node' 38/220338/1
authorMathieu Malaterre <malat@debian.org>
Thu, 24 Jan 2019 18:06:24 +0000 (19:06 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 17 Dec 2019 09:44:13 +0000 (18:44 +0900)
On one hand commit 28644c809f44 ("regmap: Add the rbtree cache support")
added 'regcache_rbtree_node' as packed structure, while on the other hand
commit e977145aeaad ("[RBTREE] Add explicit alignment to sizeof(long)
for struct rb_node.") declared struct 'rb_node' as aligned.

Solve the ambiguity of placing aligned structure in a packed one by
removing the packed attribute from struct. This seems to be the behavior
of gcc anyway.

This removes the following warning (W=1):

  drivers/base/regmap/regcache-rbtree.c:36:1: warning: alignment 1 of 'struct regcache_rbtree_node' is less than 4 [-Wpacked-not-aligned]

Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
[sw0312.kim: cherry-pick mainline commit 435bba0f11f0 for gcc 9 build]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I8ae97076f9958c629b240589a3a59c93218636eb

drivers/base/regmap/regcache-rbtree.c

index 9d09c5bb5874a46592ad2f0d87d1bcc5fb8d0552..181df3a6c10d388cb35b5f15b8554b6cc87dbf5b 100644 (file)
@@ -33,7 +33,7 @@ struct regcache_rbtree_node {
        unsigned int blklen;
        /* the actual rbtree node holding this block */
        struct rb_node node;
-} __attribute__ ((packed));
+};
 
 struct regcache_rbtree_ctx {
        struct rb_root root;