[U-Boot] [PATCH] Disaligned buffer in print_buffer

Mike Frysinger vapier at gentoo.org
Fri Aug 27 20:12:46 CEST 2010


On Friday, August 27, 2010 05:41:08 Reinhard Meyer wrote:
> Stefano Babic schrieb:
> > --- a/lib/display_options.c
> > +++ b/lib/display_options.c
> > @@ -101,7 +101,7 @@ void print_size(unsigned long long size, const char
> > *s)
> > 
> >  #define DEFAULT_LINE_LENGTH_BYTES (16)
> >  int print_buffer (ulong addr, void* data, uint width, uint count, uint
> >  linelen) {
> > 
> > -	uint8_t linebuf[MAX_LINE_LENGTH_BYTES + 1];
> > +	uint8_t linebuf[MAX_LINE_LENGTH_BYTES + 1]
> > __attribute__((__aligned__(4)));
> > 
> >  	uint32_t *uip = (void*)linebuf;
> >  	uint16_t *usp = (void*)linebuf;
> >  	uint8_t *ucp = (void*)linebuf;
> 
> Why not just declare it as
> 	uint_32t linebuf[MAX_LINE_LENGTH_BYTES/4+1];
> ?

i guess that'd be another way of doing it
-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/20100827/70be83e1/attachment.pgp 


More information about the U-Boot mailing list