From patchwork Thu Jun 13 23:13:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 251194 X-Patchwork-Delegate: agust@denx.de 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 16BDD2C013D for ; Fri, 14 Jun 2013 09:13:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 395264A0C2; Fri, 14 Jun 2013 01:13:56 +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 bJX3KRPmDAra; Fri, 14 Jun 2013 01:13:56 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 104D84A0B9; Fri, 14 Jun 2013 01:13:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D317B4A0B9 for ; Fri, 14 Jun 2013 01:13:47 +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 jD9WZFAKKVAI for ; Fri, 14 Jun 2013 01:13:42 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 580C74A0B8 for ; Fri, 14 Jun 2013 01:13:30 +0200 (CEST) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id C2EB7635A; Thu, 13 Jun 2013 17:21:54 -0600 (MDT) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 111DFE4626; Thu, 13 Jun 2013 17:13:16 -0600 (MDT) From: Stephen Warren To: Anatolij Gustschin , u-boot@lists.denx.de, Tom Rini Date: Thu, 13 Jun 2013 17:13:11 -0600 Message-Id: <1371165191-11174-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.8.1.5 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.7 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: Stephen Warren Subject: [U-Boot] [PATCH] lcd: remove unaligned access in lcd_dt_simplefb_configure_node() 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: Stephen Warren Some ARM compilers may emit code that makes unaligned accesses when faced with constructs such as: const char format[] = "r5g6b5"; Make this data static since it doesn't chagne; the compiler will simply place it into the .rodata section directly, and avoid any unaligned run- time initialization. Signed-off-by: Stephen Warren --- common/lcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lcd.c b/common/lcd.c index 3a60484..c9a589e 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -1193,7 +1193,7 @@ static int lcd_dt_simplefb_configure_node(void *blob, int off) u32 stride; fdt32_t cells[2]; int ret; - const char format[] = + static const char format[] = #if LCD_BPP == LCD_COLOR16 "r5g6b5"; #else @@ -1239,8 +1239,8 @@ static int lcd_dt_simplefb_configure_node(void *blob, int off) int lcd_dt_simplefb_add_node(void *blob) { - const char compat[] = "simple-framebuffer"; - const char disabled[] = "disabled"; + static const char compat[] = "simple-framebuffer"; + static const char disabled[] = "disabled"; int off, ret; off = fdt_add_subnode(blob, 0, "framebuffer");