Skip to contentSkip to conversation

lcd: remove unaligned access in lcd_dt_simplefb_configure_node()

PATCH New Stephen Warren 3 participants 5 messages Jun 13, 2013 – Jul 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lcd: remove unaligned access in lcd_dt_simplefb_configure_node()

From: Stephen Warren <[email protected]>

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.

---
 common/lcd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/lcd.c +3 -3
index 3a60484..c9a589e 100644
@@ -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");
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 1/1 lcd: remove unaligned access in lcd_dt_simplefb_configure_node()

Quoted 10 lines · Stephen Warren

From: Stephen Warren <[email protected]>

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.

I don't think this has been applied yet. Will it be applied for this release? Should I resend the patch?

#2 lore raw

PATCH 1/1 lcd: remove unaligned access in lcd_dt_simplefb_configure_node()

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 6 lines · Stephen Warren
Quoted 5 lines · Stephen Warren

From: Stephen Warren <[email protected]>

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

Quoted 8 lines
Quoted 5 lines

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.

I don't think this has been applied yet. Will it be applied for this release? Should I resend the patch?

It's a bug fix and as such I want it. Anatolij, there's a few "video" patches out there, are you going to grab things / has this spurred you to grab things or should I take a look around and pull up a patch set?
Thanks!

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJR0a/hAAoJENk4IS6UOR1WiV4P/RtMBhLZRq8fW9NNCaVupJC9 Y2F7kOnDOGR9jdvyWbTXA5Xvw8hMa+zx0ue3tGPf2y2rl4/EL2IPLS/PudwqTMHt n5PnTAdadOUC09OZiRz8GBENis6RBFp6xHVKDxkvdTlVx5/wItOKKfLDW60n7hM+ 4++VALba8/Ii6mWBRFdTyUEPcPCeVQxsKkfzeYrXwtBuKeEZ8f9upohfc19gscBU pGm0wsb48mJGwk8Kq0JtDmVzak4paTptJAnlA6wcqOd2MRTw7crRuVhvyLymCNki VcFtgwLI6sK7y0ohi1y3vJepL0soXGxswSRFYg2xyr8a+80uC3ZGUfkObddo+074 gGMDK7B58KVD/ZBlhsj+qpzAHUDsjRVBV01wvuTZ0FHE5DBJMISX1sYJihhLrxjc DNX+a62guUW3Zc0xJIoHckwTh7FbXgiGK+0VtJHC3ueIw0ABRs3Q2PGDa3Ud3FvA Y392ht9ftakbfIDQa/QTcw3h7VXIKfKWON621if/prsPg3GBbFV/P6AVar1NqzPR imZQdyPJimkVZs/bFjFKqH/SvYIwFuoA8jwca84XZ2kbN8aZdcgXq+GKUq83Wkyn rTr6K6c9lTixSpcpqOZMnkmT0hqglpnlVLzwZ6ONYUwtlbWK3zc6ZafxbQ2rWSLq nuQ/vigESYDEfCYIWOuQ
=EA3R
-----END PGP SIGNATURE-----

#3 lore raw

PATCH 1/1 lcd: remove unaligned access in lcd_dt_simplefb_configure_node()

Quoted 16 lines · On Mon, 1 Jul 2013 12:35:46 -0400 Tom Rini <[email protected]> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 12 lines · Stephen Warren
Quoted 10 lines · Stephen Warren

From: Stephen Warren <[email protected]>

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.

Quoted 7 lines
Quoted 2 lines

I don't think this has been applied yet. Will it be applied for this release? Should I resend the patch?

It's a bug fix and as such I want it. Anatolij, there's a few "video" patches out there, are you going to grab things / has this spurred you to grab things or should I take a look around and pull up a patch set?
Thanks!

I'll look at video patches and grab them for release. Thanks for reminding me!

Anatolij

#4 lore raw

PATCH 1/1 lcd: remove unaligned access in lcd_dt_simplefb_configure_node()

In reply to Stephen Warren
Quoted 7 lines · On Thu, 13 Jun 2013 17:13:11 -0600 Stephen Warren <[email protected]> wrote:

From: Stephen Warren <[email protected]>

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

const char format[] = "r5g6b5";

Quoted 8 lines

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.

---
 common/lcd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-video/master. Thanks!

Anatolij