From patchwork Sat Nov 5 01:55:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 123781 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 6293DB6F86 for ; Sat, 5 Nov 2011 13:05:11 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6C41B296D0; Sat, 5 Nov 2011 03:01:38 +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 XA41CxOQEUPd; Sat, 5 Nov 2011 03:01:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6386A29905; Sat, 5 Nov 2011 02:57:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6940D29702 for ; Sat, 5 Nov 2011 02:56:33 +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 THj7SSd65vQW for ; Sat, 5 Nov 2011 02:56:32 +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 C86EF29637 for ; Sat, 5 Nov 2011 02:56:10 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 443191C01CE8 for ; Sat, 5 Nov 2011 02:56:08 +0100 (CET) X-Auth-Info: aIZtLAU/SPoatpWqEZ2BRMYYXgzGpVCOc2F86DSXL00= Received: from diddl.denx.de (host-80-81-18-216.customer.m-online.net [80.81.18.216]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 286221C00061 for ; Sat, 5 Nov 2011 02:56:08 +0100 (CET) Received: from gemini.denx.de (unknown [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id D2738C8CD266 for ; Sat, 5 Nov 2011 02:56:07 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id 7ED401893015; Sat, 5 Nov 2011 02:56:07 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Sat, 5 Nov 2011 02:55:30 +0100 Message-Id: <1320458160-23136-27-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.7.6.4 In-Reply-To: <1320458160-23136-1-git-send-email-wd@denx.de> References: <1320458160-23136-1-git-send-email-wd@denx.de> Subject: [U-Boot] [PATCH 26/56] board/netta/pcmcia.c: Fix GCC 4.6 build warnings 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Fix: pcmcia.c: In function 'cfg_ports': pcmcia.c:151:21: warning: variable 'cp' set but not used [-Wunused-but-set-variable] pcmcia.c:150:20: warning: variable 'immap' set but not used [-Wunused-but-set-variable] pcmcia.c: In function 'pcmcia_hardware_enable': pcmcia.c:179:25: warning: variable 'sysp' set but not used [-Wunused-but-set-variable] pcmcia.c:177:21: warning: variable 'cp' set but not used [-Wunused-but-set-variable] pcmcia.c:176:20: warning: variable 'immap' set but not used [-Wunused-but-set-variable] pcmcia.c: In function 'pcmcia_hardware_disable': pcmcia.c:271:25: warning: variable 'pcmp' set but not used [-Wunused-but-set-variable] pcmcia.c:270:20: warning: variable 'immap' set but not used [-Wunused-but-set-variable] pcmcia.c: In function 'pcmcia_voltage_set': pcmcia.c:303:9: warning: variable 'sreg' set but not used [-Wunused-but-set-variable] pcmcia.c:300:21: warning: variable 'cp' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk --- board/netta/pcmcia.c | 76 +++++++++++++++++--------------------------------- 1 files changed, 26 insertions(+), 50 deletions(-) diff --git a/board/netta/pcmcia.c b/board/netta/pcmcia.c index ed58f2c..3fa1925 100644 --- a/board/netta/pcmcia.c +++ b/board/netta/pcmcia.c @@ -147,23 +147,16 @@ static void set_shdn(int what) static void cfg_ports (void) { - volatile immap_t *immap; - volatile cpm8xx_t *cp; - - immap = (immap_t *)CONFIG_SYS_IMMR; - cp = (cpm8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_cpm)); - - cfg_vppd(0); cfg_vppd(1); /* VPPD0,VPPD1 VAVPP => Hi-Z */ cfg_vccd(0); cfg_vccd(1); /* 3V and 5V off */ cfg_shdn(); cfg_oc(); /* - * Configure Port A for TPS2211 PC-Card Power-Interface Switch - * - * Switch off all voltages, assert shutdown - */ + * Configure Port A for TPS2211 PC-Card Power-Interface Switch + * + * Switch off all voltages, assert shutdown + */ set_vppd(0, 1); set_vppd(1, 1); set_vccd(0, 0); set_vccd(1, 0); set_shdn(1); @@ -173,10 +166,7 @@ static void cfg_ports (void) int pcmcia_hardware_enable(int slot) { - volatile immap_t *immap; - volatile cpm8xx_t *cp; volatile pcmconf8xx_t *pcmp; - volatile sysconf8xx_t *sysp; uint reg, pipr, mask; int i; @@ -184,10 +174,7 @@ int pcmcia_hardware_enable(int slot) udelay(10000); - immap = (immap_t *)CONFIG_SYS_IMMR; - sysp = (sysconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_siu_conf)); pcmp = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia)); - cp = (cpm8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_cpm)); /* Configure Ports for TPS2211A PC-Card Power-Interface Switch */ cfg_ports (); @@ -197,9 +184,9 @@ int pcmcia_hardware_enable(int slot) pcmp->pcmc_per &= ~PCMCIA_MASK(_slot_); /* - * Disable interrupts, DMA, and PCMCIA buffers - * (isolate the interface) and assert RESET signal - */ + * Disable interrupts, DMA, and PCMCIA buffers + * (isolate the interface) and assert RESET signal + */ debug ("Disable PCMCIA buffers and assert RESET\n"); reg = 0; reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */ @@ -221,8 +208,8 @@ int pcmcia_hardware_enable(int slot) } /* - * Power On: Set VAVCC to 3.3V or 5V, set VAVPP to Hi-Z - */ + * Power On: Set VAVCC to 3.3V or 5V, set VAVPP to Hi-Z + */ mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); pipr = pcmp->pcmc_pipr; debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", @@ -267,15 +254,10 @@ int pcmcia_hardware_enable(int slot) #if defined(CONFIG_CMD_PCMCIA) int pcmcia_hardware_disable(int slot) { - volatile immap_t *immap; - volatile pcmconf8xx_t *pcmp; u_long reg; debug ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); - immap = (immap_t *)CONFIG_SYS_IMMR; - pcmp = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia)); - /* Configure PCMCIA General Control Register */ debug ("Disable PCMCIA buffers and assert RESET\n"); reg = 0; @@ -296,24 +278,19 @@ int pcmcia_hardware_disable(int slot) int pcmcia_voltage_set(int slot, int vcc, int vpp) { - volatile immap_t *immap; - volatile cpm8xx_t *cp; volatile pcmconf8xx_t *pcmp; u_long reg; - ushort sreg; debug ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, Vcc=%d.%d, Vpp=%d.%d\n", 'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10); - immap = (immap_t *)CONFIG_SYS_IMMR; - cp = (cpm8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_cpm)); pcmp = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia)); /* - * Disable PCMCIA buffers (isolate the interface) - * and assert RESET signal - */ + * Disable PCMCIA buffers (isolate the interface) + * and assert RESET signal + */ debug ("Disable PCMCIA buffers and assert RESET\n"); reg = PCMCIA_PGCRX(_slot_); reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */ @@ -322,30 +299,29 @@ int pcmcia_voltage_set(int slot, int vcc, int vpp) udelay(500); /* - * Configure Port C pins for - * 5 Volts Enable and 3 Volts enable, - * Turn all power pins to Hi-Z - */ + * Configure Port C pins for + * 5 Volts Enable and 3 Volts enable, + * Turn all power pins to Hi-Z + */ debug ("PCMCIA power OFF\n"); cfg_ports (); /* Enables switch, but all in Hi-Z */ - sreg = immap->im_ioport.iop_pcdat; set_vppd(0, 1); set_vppd(1, 1); switch(vcc) { - case 0: - break; /* Switch off */ + case 0: + break; /* Switch off */ - case 33: - set_vccd(0, 1); set_vccd(1, 0); - break; + case 33: + set_vccd(0, 1); set_vccd(1, 0); + break; - case 50: - set_vccd(0, 0); set_vccd(1, 1); - break; + case 50: + set_vccd(0, 0); set_vccd(1, 1); + break; - default: - goto done; + default: + goto done; } /* Checking supported voltages */