]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lcd: remove unaligned access in lcd_dt_simplefb_configure_node()
authorStephen Warren <swarren@nvidia.com>
Thu, 13 Jun 2013 23:13:11 +0000 (17:13 -0600)
committerAnatolij Gustschin <agust@denx.de>
Mon, 1 Jul 2013 18:11:33 +0000 (20:11 +0200)
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

index 3a60484eea615a4f20bd78109f738de26478c88f..c9a589e976ce78d8f3c82612db3d97d55c906c41 100644 (file)
@@ -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");