From patchwork Tue Dec 21 08:07:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 76267 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 46A53B6EF1 for ; Tue, 21 Dec 2010 19:07:25 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A823D280EA; Tue, 21 Dec 2010 09:07:23 +0100 (CET) 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 TMXObe-UhLCk; Tue, 21 Dec 2010 09:07:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 231AF280D4; Tue, 21 Dec 2010 09:07:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D13F280D4 for ; Tue, 21 Dec 2010 09:07:19 +0100 (CET) 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 2YP+1VWzFkXv for ; Tue, 21 Dec 2010 09:07:17 +0100 (CET) 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-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTP id 04CAC280CE for ; Tue, 21 Dec 2010 09:07:15 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id DA8BA1C089E3; Tue, 21 Dec 2010 09:07:14 +0100 (CET) X-Auth-Info: /HXalK90BZAmRRI8CypmFLbkCnmszAyqASRpON0Br/k= Received: from diddl.denx.de (ppp-188-174-79-57.dynamic.mnet-online.de [188.174.79.57]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id AE9D81C0021C; Tue, 21 Dec 2010 09:07:14 +0100 (CET) Received: from gemini.denx.de (unknown [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id 87478316E51C; Tue, 21 Dec 2010 09:07:14 +0100 (CET) Received: from gemini.denx.de (localhost.localdomain [127.0.0.1]) by gemini.denx.de (Postfix) with ESMTP id 6FBA5B715C; Tue, 21 Dec 2010 09:07:14 +0100 (CET) To: John Rigby From: Wolfgang Denk MIME-Version: 1.0 In-reply-to: <1292894871-1436-1-git-send-email-john.rigby@linaro.org> References: <1292894871-1436-1-git-send-email-john.rigby@linaro.org> Comments: In-reply-to John Rigby message dated "Mon, 20 Dec 2010 18:27:51 -0700." Date: Tue, 21 Dec 2010 09:07:14 +0100 Message-Id: <20101221080714.6FBA5B715C@gemini.denx.de> Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH] Move DECLARE_GLOBAL_DATA_PTR to file scope X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Dear John Rigby, In message <1292894871-1436-1-git-send-email-john.rigby@linaro.org> you wrote: > It can be optimised out by the compiler otherwise resulting > in obscure errors like a board not booting. > > This has been documented in README since 2006 when these were > first fixed up for GCC 4.x. > > Signed-off-by: John Rigby Thanks for the cleanup. Much appreciated. However, this patch appears to miss a few places. I think we should additionally change the following: From 2ff61b7d2c288508d4873f1f80f7549886e00ee2 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Tue, 21 Dec 2010 08:46:24 +0100 Subject: [PATCH] Move DECLARE_GLOBAL_DATA_PTR to file scope Fix some additional places. Signed-off-by: Wolfgang Denk --- arch/arm/cpu/armv7/mx5/speed.c | 2 ++ arch/m68k/cpu/mcf52x2/cpu.c | 3 +-- arch/sh/lib/board.c | 3 --- board/logicpd/zoom1/zoom1.c | 1 - board/samsung/smdk6400/smdk6400.c | 2 -- drivers/serial/serial_sh.c | 1 - 6 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/cpu/armv7/mx5/speed.c b/arch/arm/cpu/armv7/mx5/speed.c index 826b3b1..2187e8e 100644 --- a/arch/arm/cpu/armv7/mx5/speed.c +++ b/arch/arm/cpu/armv7/mx5/speed.c @@ -28,7 +28,9 @@ #include #include +#ifdef CONFIG_FSL_ESDHC DECLARE_GLOBAL_DATA_PTR; +#endif int get_clocks(void) { diff --git a/arch/m68k/cpu/mcf52x2/cpu.c b/arch/m68k/cpu/mcf52x2/cpu.c index 9fb717c..fb60462 100644 --- a/arch/m68k/cpu/mcf52x2/cpu.c +++ b/arch/m68k/cpu/mcf52x2/cpu.c @@ -74,8 +74,7 @@ int watchdog_disable(void) { volatile wdog_t *wdt = (volatile wdog_t *)(MMAP_WDOG); - wdt->sr = 0x5555; /* reset watchdog counteDECLARE_GLOBAL_DATA_PTR; -r */ + wdt->sr = 0x5555; /* reset watchdog counter */ wdt->sr = 0xAAAA; wdt->cr = 0; /* disable watchdog timer */ diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c index 8f50b09..3d201b2 100644 --- a/arch/sh/lib/board.c +++ b/arch/sh/lib/board.c @@ -99,7 +99,6 @@ static int sh_mem_env_init(void) #if defined(CONFIG_CMD_NET) static int sh_net_init(void) { - DECLARE_GLOBAL_DATA_PTR; gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr"); return 0; } @@ -139,8 +138,6 @@ init_fnc_t *init_sequence[] = void sh_generic_init(void) { - DECLARE_GLOBAL_DATA_PTR; - bd_t *bd; init_fnc_t **init_fnc_ptr; diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c index efc2e1d..7ef13cc 100644 --- a/board/logicpd/zoom1/zoom1.c +++ b/board/logicpd/zoom1/zoom1.c @@ -41,7 +41,6 @@ DECLARE_GLOBAL_DATA_PTR; - /* * Routine: board_init * Description: Early hardware init. diff --git a/board/samsung/smdk6400/smdk6400.c b/board/samsung/smdk6400/smdk6400.c index bc22f0f..35aa40b 100644 --- a/board/samsung/smdk6400/smdk6400.c +++ b/board/samsung/smdk6400/smdk6400.c @@ -80,8 +80,6 @@ int board_init(void) int dram_init(void) { - DECLARE_GLOBAL_DATA_PTR; - gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c index 30dea7c..0103a29 100644 --- a/drivers/serial/serial_sh.c +++ b/drivers/serial/serial_sh.c @@ -23,7 +23,6 @@ DECLARE_GLOBAL_DATA_PTR; - #if defined(CONFIG_CONS_SCIF0) # define SCIF_BASE SCIF0_BASE #elif defined(CONFIG_CONS_SCIF1)