diff options
author | Lan Yixun (dlan) <dennis.yxun@gmail.com> | 2013-06-27 18:58:53 +0800 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-07-15 17:06:13 -0400 |
commit | 0eb33ad253026d5a773854dd42b2a56937678aa9 (patch) | |
tree | af24e8f0e8b86acd2964d15331913e15b3a699fb | |
parent | 457dd025a2899dd486e594ce3dc4afaa4ea09998 (diff) | |
download | u-boot-imx-0eb33ad253026d5a773854dd42b2a56937678aa9.zip u-boot-imx-0eb33ad253026d5a773854dd42b2a56937678aa9.tar.gz u-boot-imx-0eb33ad253026d5a773854dd42b2a56937678aa9.tar.bz2 |
common: remove unaligned access error in bootmenu_getoption()
Some ARM compilers may emit code that makes unaligned accesses when
faced with constructs such as:
char name[12] = "bootmenu_";
same fix as commit: 064d55f8bc8d7d205ed0be6abb6717e92eeb7cad
=========================================================
data abort
MAYBE you should read doc/README.arm-unaligned-accesses
pc : [<3ff4b60c>] lr : [<3ff4b7b0>]
sp : 3f346a58 ip : 3ff9c8e6 fp : 02000060
r10: 00000000 r9 : 3df47fc0 r8 : 3f347f40
r7 : 00000000 r6 : 00000000 r5 : 00000003 r4 : 3f759140
r3 : 000003f0 r2 : 00000000 r1 : 000003f1 r0 : 00000000
Flags: nzCv IRQs on FIQs off Mode SVC_32
Resetting CPU ...
======================================================
Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
-rw-r--r-- | common/cmd_bootmenu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/cmd_bootmenu.c b/common/cmd_bootmenu.c index a3cbffa..7cb6876 100644 --- a/common/cmd_bootmenu.c +++ b/common/cmd_bootmenu.c @@ -64,12 +64,12 @@ enum bootmenu_key { static char *bootmenu_getoption(unsigned short int n) { - char name[MAX_ENV_SIZE] = "bootmenu_"; + char name[MAX_ENV_SIZE]; if (n > MAX_COUNT) return NULL; - sprintf(name + 9, "%d", n); + sprintf(name, "bootmenu_%d", n); return getenv(name); } |