Commit 5af7d0f090b9fe2464d7980841b940846a547716

Authored by Stephen Warren
Committed by Anatolij Gustschin
1 parent b1d8654b41

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>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -1193,7 +1193,7 @@
1193 1193 u32 stride;
1194 1194 fdt32_t cells[2];
1195 1195 int ret;
1196   - const char format[] =
  1196 + static const char format[] =
1197 1197 #if LCD_BPP == LCD_COLOR16
1198 1198 "r5g6b5";
1199 1199 #else
... ... @@ -1239,8 +1239,8 @@
1239 1239  
1240 1240 int lcd_dt_simplefb_add_node(void *blob)
1241 1241 {
1242   - const char compat[] = "simple-framebuffer";
1243   - const char disabled[] = "disabled";
  1242 + static const char compat[] = "simple-framebuffer";
  1243 + static const char disabled[] = "disabled";
1244 1244 int off, ret;
1245 1245  
1246 1246 off = fdt_add_subnode(blob, 0, "framebuffer");