[U-Boot] [PATCH v3 5/6] omap4+: Avoid using __attribute__ ((__packed__))

Mike Frysinger vapier at gentoo.org
Thu Feb 23 16:03:01 CET 2012


On Thursday 23 February 2012 09:21:00 Tom Rini wrote:
> On Thu, Feb 23, 2012 at 7:06 AM, Aneesh V <aneesh at ti.com> wrote:
> > Avoid using __attribute__ ((__packed__)) unless it's
> > absolutely necessary. "packed" will remove alignment
> > requirements for the respective objects and may cause
> > alignment issues unless alignment is also enforced
> > using a pragma.
> > 
> > Here, these packed attributes were causing alignment
> > faults in Thumb build.
> 
> Why did we pack these to start with?  Otherwise seems fine (and I see
> the rest of the TI parts don't have this particular packing).

because these represent hardware register blocks which get used with writew() 
and typically those blocks get marked packed.

if the arch won't introduce padding with the members, then this change should 
be ok, and looking at the structs which are just 2 16bit members, that should 
be the case here.

if you really want to be pedantic, i think the alternative would be:
	struct pad_conf_entry {} __packed __aligned(2);
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120223/63ec23cf/attachment.pgp>


More information about the U-Boot mailing list