[U-Boot] [PATCH] cmd/fdt.c align data buffer to avoid unaligned word access

Simon Glass sjg at chromium.org
Mon Oct 9 04:47:13 UTC 2017


On 28 September 2017 at 03:29, Bernhard Messerklinger
<bernhard.messerklinger at br-automation.com> wrote:
> Since the compiler is free to place a char array to any address in
> memory (in this case the stack), also to a non word aligned address the
> function "fdt_prop_parse" runs into troubles upon it wants to write some
> (fdt32_t *) to such a variable (if it has been placed to a none word
> aligned address).
>
> To avoid this we tell the compiler to always align this scratchpad to a
> word aligned address.
>
> Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger at br-automation.com>
> ---
>
>  cmd/fdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list