summaryrefslogtreecommitdiff
path: root/common/lcd.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2013-06-13 17:13:11 -0600
committerJason Liu <r64343@freescale.com>2013-11-22 13:11:03 +0800
commit9589ff33327fc038be7c302e71377582738d8fde (patch)
tree288cec77d069524b102df6f479385e04722a4949 /common/lcd.c
parent68c9ed925b8f07d3050765efc2eadd0098a247fe (diff)
downloadu-boot-imx-9589ff33327fc038be7c302e71377582738d8fde.zip
u-boot-imx-9589ff33327fc038be7c302e71377582738d8fde.tar.gz
u-boot-imx-9589ff33327fc038be7c302e71377582738d8fde.tar.bz2
lcd: remove unaligned access in lcd_dt_simplefb_configure_node()
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> (cherry picked from commit 5af7d0f090b9fe2464d7980841b940846a547716) Signed-off-by: Jason Liu <r64343@freescale.com>
Diffstat (limited to 'common/lcd.c')
-rw-r--r--common/lcd.c6
1 files 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");