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

Wolfgang Denk wd at denx.de
Wed Sep 8 09:48:57 CEST 2010


Dear Reinhard Meyer,

In message <4C87065A.5050904 at emk-elektronik.de> you wrote:
> Dear Wolfgang Denk,
> >> +	/* linebuf as a union causes proper alignment */
> >> +	union linebuf {
> >> +		uint32_t ui[MAX_LINE_LENGTH_BYTES/4 + 1];
> >> +		uint16_t us[MAX_LINE_LENGTH_BYTES/2 + 1];
> >> +		uint8_t  uc[MAX_LINE_LENGTH_BYTES/1 + 1];
> >
> > Please replace the magic numbers 4, 2 and 1 by respective sizeof().
> 
> 
> AND
> 
> 
>  > Please let's use the attribute version.
> 
> Which shall it be now???

Well, my personal preference would be to use "attribute", but after
the long discussion it seems the general preference is the version
above so I will not block this.  I just ask to change the "magic
numbers" 1, 2 and 4 into sizeof() so it's obvious where these are
coming from.

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
Hello! I'm from outer space,  and I've made myself look like a signa-
ture.  While  you  are reading this, I'm having sex with your eyes. I
know it feels good to you, because you're smiling. I'm very horny, so
send me to someone else when you've had enough. Thanks!
                              Sincerely, A Stranger in a Strange Land


More information about the U-Boot mailing list