[U-Boot] [PATCH] input: fix unaligned access in key_matrix_decode_fdt()

Stephen Warren swarren at wwwdotorg.org
Tue Jun 4 21:29:24 CEST 2013


On 05/22/2013 12:48 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren at nvidia.com>
> 
> Initialized character arrays on the stack can cause gcc to emit code that
> performs unaligned accessess. Make the data static to avoid this.
> 
> Note that the unaligned accesses are made when copying data to prefix[] on
> the stack from .rodata. By making the data static, the copy is completely
> avoided. All explicitly written code treats the data as u8[], so will never
> cause any unaligned accesses.

Tom, does this patch look good?

The discussion following it was unrelated to this patch, but rather
related to pre-processing of device-trees, so I don't think should
prevent this patch being merged.


More information about the U-Boot mailing list