]> git.sur5r.net Git - u-boot/commit
cmd/fdt.c align data buffer to avoid unaligned word access
authorBernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Thu, 28 Sep 2017 09:29:52 +0000 (11:29 +0200)
committerSimon Glass <sjg@chromium.org>
Fri, 17 Nov 2017 01:45:05 +0000 (18:45 -0700)
commit6dfd65f81fd060a85c961a84f85a286e8e96332c
tree1b4ac320e97f0783e5da9c88efe8e31eb409f636
parentc253573f3e269fd9a24ee6684d87dd91106018a5
cmd/fdt.c align data buffer to avoid unaligned word access

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@br-automation.com>
Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/fdt.c