From patchwork Thu Jun 27 10:58:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dennis Lan (dlan)" X-Patchwork-Id: 255037 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id F374B2C007B for ; Thu, 27 Jun 2013 21:03:48 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ADF4D4A026; Thu, 27 Jun 2013 13:03:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WFYsn+SJk5ri; Thu, 27 Jun 2013 13:03:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8E0AF4A01E; Thu, 27 Jun 2013 13:03:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D72E34A01E for ; Thu, 27 Jun 2013 13:03:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GpQhAls-g+Z9 for ; Thu, 27 Jun 2013 13:03:26 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 66AB04A01C for ; Thu, 27 Jun 2013 13:03:17 +0200 (CEST) Received: by mail-pb0-f44.google.com with SMTP id uo1so769229pbc.17 for ; Thu, 27 Jun 2013 04:03:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=pF8yqSABJ3bC2Juj4s/JE3B1693SJuhZ0eOcOo+Wcig=; b=0pEy84P/U/b8xFMMAZH9OfPziWBFq6nT2e7FfEN/ydqEABr/YK3a6QVqZXP1AJHB2N OrutMDR6JxkbuJT4KkbVqlrEb3tpjF1MiONELLNBEJ2dHdZ/6DwmBpEE4lSkbylVM7Xl t1PT/qa7o9YnvtNfgHA66w1v7kn/3BRwqRl1gBIfyM/pWL8zHRWHXmXw5UE/qwjq9JVv fULhdHOxEXZY5hk6HbS8MYuaLFxI6dlvB0lt0ynvRvRVSLdY7vgQQvtqYMiiUFAO64R+ 6SF9lDzlkCTG0Jj+HR9hQBHizphuyXj4GyUxY1geQ6Ixt5nJu8LH91b+hTol8rXP5NPC 4Zmg== X-Received: by 10.68.202.7 with SMTP id ke7mr5355433pbc.82.1372330993148; Thu, 27 Jun 2013 04:03:13 -0700 (PDT) Received: from localhost.localdomain ([116.228.88.134]) by mx.google.com with ESMTPSA id br1sm2709320pbb.4.2013.06.27.04.03.10 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Jun 2013 04:03:12 -0700 (PDT) From: "Lan Yixun (dlan)" To: u-boot@lists.denx.de Date: Thu, 27 Jun 2013 18:58:53 +0800 Message-Id: <1372330733-28031-1-git-send-email-dennis.yxun@gmail.com> X-Mailer: git-send-email 1.8.2.1 Subject: [U-Boot] [PATCH] common: remove unaligned access error in bootmenu_getoption() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: "Lan Yixun (dlan)" 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) --- common/cmd_bootmenu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/cmd_bootmenu.c b/common/cmd_bootmenu.c index 7041273..d414c17 100644 --- a/common/cmd_bootmenu.c +++ b/common/cmd_bootmenu.c @@ -65,12 +65,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); }