From patchwork Sat Nov 5 01:55:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 123767 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 833DBB700E for ; Sat, 5 Nov 2011 13:02:59 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B7D2529AE3; Sat, 5 Nov 2011 03:00: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 t6ufXvOaGAZS; Sat, 5 Nov 2011 03:00:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 936C9298A4; Sat, 5 Nov 2011 02:57:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 308F5296CB for ; Sat, 5 Nov 2011 02:56:30 +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 VDd8zAHKRAnc for ; Sat, 5 Nov 2011 02:56:29 +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 309822961F 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 757E91C01D9E for ; Sat, 5 Nov 2011 02:56:07 +0100 (CET) X-Auth-Info: 2K9kTnRSpiGRvkVtx9UgO9R3W2SdGW75HlKBs1JNMmo= 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 68E721C00061 for ; Sat, 5 Nov 2011 02:56:07 +0100 (CET) Received: from gemini.denx.de (unknown [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id 30F51C8CD262 for ; Sat, 5 Nov 2011 02:56:07 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id 133401893013; 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:21 +0100 Message-Id: <1320458160-23136-18-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 17/56] mpc8xx/fec.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: fec.c: In function 'fec_pin_init': fec.c:381:18: warning: variable 'fecp' set but not used [-Wunused-but-set-variable] fec.c: In function 'fec8xx_miiphy_write': fec.c:1013:8: warning: variable 'rdreg' set but not used [-Wunused-but-set-variable] Note: The code was slightly rearranged, but no functional changes attempted, i. e. no conversion to use I/O accessors. Signed-off-by: Wolfgang Denk --- arch/powerpc/cpu/mpc8xx/fec.c | 47 +++++++++++++++++++++------------------- 1 files changed, 25 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xx/fec.c b/arch/powerpc/cpu/mpc8xx/fec.c index a2d2bd6..f2a2c3a 100644 --- a/arch/powerpc/cpu/mpc8xx/fec.c +++ b/arch/powerpc/cpu/mpc8xx/fec.c @@ -378,35 +378,39 @@ static void fec_pin_init(int fecidx) { bd_t *bd = gd->bd; volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; - volatile fec_t *fecp; - - /* - * only two FECs please - */ - if ((unsigned int)fecidx >= 2) - hang(); - - if (fecidx == 0) - fecp = &immr->im_cpm.cp_fec1; - else - fecp = &immr->im_cpm.cp_fec2; /* * Set MII speed to 2.5 MHz or slightly below. - * * According to the MPC860T (Rev. D) Fast ethernet controller user - * * manual (6.2.14), - * * the MII management interface clock must be less than or equal - * * to 2.5 MHz. - * * This MDC frequency is equal to system clock / (2 * MII_SPEED). - * * Then MII_SPEED = system_clock / 2 * 2,5 MHz. + * + * According to the MPC860T (Rev. D) Fast ethernet controller user + * manual (6.2.14), + * the MII management interface clock must be less than or equal + * to 2.5 MHz. + * This MDC frequency is equal to system clock / (2 * MII_SPEED). + * Then MII_SPEED = system_clock / 2 * 2,5 MHz. * * All MII configuration is done via FEC1 registers: */ immr->im_cpm.cp_fec1.fec_mii_speed = ((bd->bi_intfreq + 4999999) / 5000000) << 1; #if defined(CONFIG_NETTA) || defined(CONFIG_NETPHONE) || defined(CONFIG_NETTA2) - /* our PHYs are the limit at 2.5 MHz */ - fecp->fec_mii_speed <<= 1; + { + volatile fec_t *fecp; + + /* + * only two FECs please + */ + if ((unsigned int)fecidx >= 2) + hang(); + + if (fecidx == 0) + fecp = &immr->im_cpm.cp_fec1; + else + fecp = &immr->im_cpm.cp_fec2; + + /* our PHYs are the limit at 2.5 MHz */ + fecp->fec_mii_speed <<= 1; + } #endif #if defined(CONFIG_MPC885_FAMILY) && defined(WANT_MII) @@ -1010,11 +1014,10 @@ int fec8xx_miiphy_read(const char *devname, unsigned char addr, int fec8xx_miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value) { - short rdreg; /* register working value */ #ifdef MII_DEBUG printf ("miiphy_write(0x%x) @ 0x%x = ", reg, addr); #endif - rdreg = mii_send(mk_mii_write(addr, reg, value)); + (void)mii_send(mk_mii_write(addr, reg, value)); #ifdef MII_DEBUG printf ("0x%04x\n", value);