From patchwork Fri Dec 9 11:14:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 130351 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 954F61007D7 for ; Fri, 9 Dec 2011 22:16:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7C467281FC; Fri, 9 Dec 2011 12:16:14 +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 rSXJMltzxxbx; Fri, 9 Dec 2011 12:16:14 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 86DA928144; Fri, 9 Dec 2011 12:15:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8471F28130 for ; Fri, 9 Dec 2011 12:14:43 +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 hjxa5N+WSggF for ; Fri, 9 Dec 2011 12:14:43 +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.10]) by theia.denx.de (Postfix) with ESMTP id D1EDA28151 for ; Fri, 9 Dec 2011 12:14:36 +0100 (CET) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 184BD1801123; 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 6C4701C00119; 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 43C511A3760; Fri, 9 Dec 2011 12:14:35 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id C28541A32834; 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:31 +0100 Message-Id: <1323429272-26801-13-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> Cc: Dave Peverley Subject: [U-Boot] [PATCH 12/13] board/ti/omap730p2/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:122:10: warning: variable 'pOrgDef' set but not used [-Wunused-but-set-variable] flash.c: In function 'flash_erase': flash.c:263:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable] flash.c: In function 'write_data': flash.c:439:6: warning: variable 'flag' set but not used [-Wunused-but-set-variable] Signed-off-by: Wolfgang Denk Cc: Dave Peverley Acked-by: Tom Rini --- board/ti/omap730p2/flash.c | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/board/ti/omap730p2/flash.c b/board/ti/omap730p2/flash.c index 185bc2d..a292627 100644 --- a/board/ti/omap730p2/flash.c +++ b/board/ti/omap730p2/flash.c @@ -119,9 +119,7 @@ unsigned long flash_init (void) 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; } @@ -335,6 +333,10 @@ int flash_erase (flash_info_t * info, int s_first, int s_last) printf (" done\n"); } } + + if (flag) + enable_interrupts(); + return rcode; } @@ -436,7 +438,7 @@ 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 */ @@ -456,12 +458,15 @@ 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; } } - *addr = (FPW) 0x00FF00FF; /* restore read mode */ - return (0); +done: + *addr = (FPW)0x00FF00FF; /* restore read mode */ + if (flag) + enable_interrupts(); + return rc; } void inline spin_wheel (void)