From patchwork Fri Dec 9 11:14:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 130350 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 5B7E11007D7 for ; Fri, 9 Dec 2011 22:16:44 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9D3F42814E; Fri, 9 Dec 2011 12:16:06 +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 PqpQhXOGTPyu; Fri, 9 Dec 2011 12:16:06 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A954028195; Fri, 9 Dec 2011 12:15:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9AD1528154 for ; Fri, 9 Dec 2011 12:14:41 +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 PnStt04DUbN0 for ; Fri, 9 Dec 2011 12:14:40 +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 6FC342814D for ; Fri, 9 Dec 2011 12:14:36 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 683771C0C111 for ; Fri, 9 Dec 2011 12:14:35 +0100 (CET) X-Auth-Info: 4E296MRz1vVAcZSBAO3Z71NOL1ZOjwNmP1JTcYL9ANc= 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 5F9521C00106 for ; Fri, 9 Dec 2011 12:14:35 +0100 (CET) Received: from gemini.denx.de (unknown [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id EBDB81A375F for ; Fri, 9 Dec 2011 12:14:34 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id AE1511ECC63; Fri, 9 Dec 2011 12:14:34 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Fri, 9 Dec 2011 12:14:29 +0100 Message-Id: <1323429272-26801-11-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1323429272-26801-1-git-send-email-wd@denx.de> References: <1323429272-26801-1-git-send-email-wd@denx.de> Subject: [U-Boot] [PATCH 10/13] board/ti/omap1610inn/flash.c: Fix GCC 4.6 build warnings 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 Fix: flash.c: In function 'flash_get_offsets': flash.c:139:10: warning: variable 'pOrgDef' set but not used [-Wunused-but-set-variable] flash.c: In function 'flash_erase': flash.c:280:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable] flash.c: In function 'write_data': flash.c:456:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk Acked-by: Tom Rini --- board/ti/omap1610inn/flash.c | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/board/ti/omap1610inn/flash.c b/board/ti/omap1610inn/flash.c index 1b67d08..a99a91c 100644 --- a/board/ti/omap1610inn/flash.c +++ b/board/ti/omap1610inn/flash.c @@ -136,9 +136,7 @@ void flash_unlock(flash_info_t * info) static void flash_get_offsets (ulong base, flash_info_t * info) { int i; - OrgDef *pOrgDef; - pOrgDef = OrgIntel_28F256L18T; if (info->flash_id == FLASH_UNKNOWN) { return; } @@ -352,6 +350,9 @@ int flash_erase (flash_info_t * info, int s_first, int s_last) printf (" done\n"); } } + if (flag) + enable_interrupts(); + return rcode; } @@ -453,13 +454,13 @@ static int write_data (flash_info_t * info, ulong dest, FPW data) { FPWV *addr = (FPWV *) dest; ulong status; - int flag; + int flag, rc = 0; ulong start; /* Check if Flash is (sufficiently) erased */ if ((*addr & data) != data) { - printf ("not erased at %08lx (%x)\n", (ulong) addr, *addr); - return (2); + printf("not erased at %08lx (%x)\n", (ulong) addr, *addr); + return 2; } /* Disable interrupts which might cause a timeout here */ flag = disable_interrupts (); @@ -472,12 +473,16 @@ static int write_data (flash_info_t * info, ulong dest, FPW data) /* wait while polling the status register */ while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) { if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { - *addr = (FPW) 0x00FF00FF; /* restore read mode */ - return (1); + rc = 1; + goto done; } } +done: + if (flag) + enable_interrupts(); + *addr = (FPW) 0x00FF00FF; /* restore read mode */ - return (0); + return rc; } void inline spin_wheel (void)