public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] lcd: remove unaligned access in lcd_dt_simplefb_configure_node()
@ 2013-06-13 23:13 Stephen Warren
  2013-07-01 16:30 ` Stephen Warren
  2013-07-01 18:13 ` Anatolij Gustschin
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Warren @ 2013-06-13 23:13 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

Some ARM compilers may emit code that makes unaligned accesses when
faced with constructs such as:

const char format[] = "r5g6b5";

Make this data static since it doesn't chagne; the compiler will simply
place it into the .rodata section directly, and avoid any unaligned run-
time initialization.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 common/lcd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 3a60484..c9a589e 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -1193,7 +1193,7 @@ static int lcd_dt_simplefb_configure_node(void *blob, int off)
 	u32 stride;
 	fdt32_t cells[2];
 	int ret;
-	const char format[] =
+	static const char format[] =
 #if LCD_BPP == LCD_COLOR16
 		"r5g6b5";
 #else
@@ -1239,8 +1239,8 @@ static int lcd_dt_simplefb_configure_node(void *blob, int off)
 
 int lcd_dt_simplefb_add_node(void *blob)
 {
-	const char compat[] = "simple-framebuffer";
-	const char disabled[] = "disabled";
+	static const char compat[] = "simple-framebuffer";
+	static const char disabled[] = "disabled";
 	int off, ret;
 
 	off = fdt_add_subnode(blob, 0, "framebuffer");
-- 
1.8.1.5

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

end of thread, other threads:[~2013-07-01 18:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13 23:13 [U-Boot] [PATCH] lcd: remove unaligned access in lcd_dt_simplefb_configure_node() Stephen Warren
2013-07-01 16:30 ` Stephen Warren
2013-07-01 16:35   ` Tom Rini
2013-07-01 18:08     ` Anatolij Gustschin
2013-07-01 18:13 ` Anatolij Gustschin

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