From: Mike Frysinger Date: Fri, 27 Aug 2010 14:12:46 -0400 Subject: [U-Boot] [PATCH] Disaligned buffer in print_buffer In-Reply-To: <4C778834.9030901@emk-elektronik.de> References: <1282215718-2910-1-git-send-email-sbabic@denx.de> <4C778834.9030901@emk-elektronik.de> Message-ID: <201008271412.47799.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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