[U-Boot] [PATCH] display_buffer: fix misaligned buffer

Wolfgang Denk wd at denx.de
Wed Sep 8 01:22:16 CEST 2010


Dear Reinhard Meyer,

In message <4C7B7864.2080607 at emk-elektronik.de> you wrote:
> 
> One could add a comment above like:
> 	/*
> 	 * it is mandatory that linebuf stays uint32_t aligned
> 	 * since we are going to slide along it with a uint32_t
> 	 * pointer
> 	 */
> 	uint32_t linebuf[MAX_LINE_LENGTH_BYTES/4 + 1];

...and using the attribute avoids the ugly code and all the 5 lines of
comment because it's self-explanatory.

> I personally prefer this above an attribute. Its disputeable but I prefer
> to do things with "normal C constructs" where possible. You can already
> see from the discussion that __aligned as a toolchain-abstracted
> variant (defined in a toolchain header file) or attribute((__aligned__))
> as a very toolchain dependant variant shall be used ;)
> 
> Anyway, both patches have been offered, any will work for me as long as
> I can see ASCII properly on ARM machines...

Please let's use the attribute version.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"355/113 -- Not the famous irrational number PI,  but  an  incredible
simulation!"


More information about the U-Boot mailing list