public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Disaligned buffer in print_buffer
@ 2010-08-19 11:01 Stefano Babic
  2010-08-19 15:35 ` Mike Frysinger
  2010-08-27  9:41 ` Reinhard Meyer
  0 siblings, 2 replies; 10+ messages in thread
From: Stefano Babic @ 2010-08-19 11:01 UTC (permalink / raw)
  To: u-boot

As linebuf is accessed with 32-bit pointers, its address
must be 32 bit aligned to avoid misaligned access.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 lib/display_options.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/display_options.c b/lib/display_options.c
index 20319e6..30374f9 100644
--- 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;
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-08-28  7:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-19 11:01 [U-Boot] [PATCH] Disaligned buffer in print_buffer Stefano Babic
2010-08-19 15:35 ` Mike Frysinger
2010-08-19 16:33   ` Stefano Babic
2010-08-20  7:46     ` Albert ARIBAUD
2010-08-27  9:41 ` Reinhard Meyer
2010-08-27 18:12   ` Mike Frysinger
2010-08-27 18:24   ` Stefano Babic
2010-08-27 19:06     ` Reinhard Meyer
2010-08-28  6:56       ` Albert ARIBAUD
2010-08-28  7:17         ` Reinhard Meyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox