2013-03-14 15:26:24

by Dimitris Papastamos

[permalink] [raw]
Subject: [PATCH] regmap: Remove __attribute__ ((packed))

There is no point having this. The space gains are trivial if there
are any at all.

Change-Id: Ib4b1320420f780dcf5b9a1e4b05f5805691c4d9f
Signed-off-by: Dimitris Papastamos <[email protected]>
---
drivers/base/regmap/regcache-rbtree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
index dd5ed6c..383fc00 100644
--- a/drivers/base/regmap/regcache-rbtree.c
+++ b/drivers/base/regmap/regcache-rbtree.c
@@ -31,7 +31,7 @@ struct regcache_rbtree_node {
void *block;
/* number of registers available in the block */
unsigned int blklen;
-} __attribute__ ((packed));
+};

struct regcache_rbtree_ctx {
struct rb_root root;
--
1.8.1.5


2013-03-15 01:36:43

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regmap: Remove __attribute__ ((packed))

On Thu, Mar 14, 2013 at 03:26:19PM +0000, Dimitris Papastamos wrote:
> There is no point having this. The space gains are trivial if there
> are any at all.

Applied, but numbers would have been nice and...

> Change-Id: Ib4b1320420f780dcf5b9a1e4b05f5805691c4d9f

...this shouldn't be in upstream submissions.


Attachments:
(No filename) (311.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-03-15 11:16:07

by Dimitris Papastamos

[permalink] [raw]
Subject: Re: [PATCH] regmap: Remove __attribute__ ((packed))

On Fri, Mar 15, 2013 at 01:36:40AM +0000, Mark Brown wrote:
> On Thu, Mar 14, 2013 at 03:26:19PM +0000, Dimitris Papastamos wrote:
> > There is no point having this. The space gains are trivial if there
> > are any at all.
>
> Applied, but numbers would have been nice and...
>
> > Change-Id: Ib4b1320420f780dcf5b9a1e4b05f5805691c4d9f
>
> ...this shouldn't be in upstream submissions.

Oops, sorry for the Change-Id.

On my system there was no benefit of using it, it just happens
that the struct is aligned properly and needs no padding.

Thanks,
Dimitris

2013-03-15 16:53:59

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regmap: Remove __attribute__ ((packed))

On Fri, Mar 15, 2013 at 11:16:02AM +0000, Dimitris Papastamos wrote:

> On my system there was no benefit of using it, it just happens
> that the struct is aligned properly and needs no padding.

OK, so which system was that and is it not possible that other systems
will get something useful from this?


Attachments:
(No filename) (304.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-03-15 21:22:56

by Dimitris Papastamos

[permalink] [raw]
Subject: Re: [PATCH] regmap: Remove __attribute__ ((packed))

On Fri, Mar 15, 2013 at 04:53:51PM +0000, Mark Brown wrote:
> On Fri, Mar 15, 2013 at 11:16:02AM +0000, Dimitris Papastamos wrote:
>
> > On my system there was no benefit of using it, it just happens
> > that the struct is aligned properly and needs no padding.
>
> OK, so which system was that and is it not possible that other systems
> will get something useful from this?

Well I guess it has to do with the gcc cross compiler version that
I've got and the actual data layout of the linking rbtree node.
The data seems to be aligned on a 4-byte boundary anyhow and
that should be ok for many systems.

Thanks,
Dimitris