From patchwork Sat Nov 5 15:13:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 123861 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 65D30B70BB for ; Sun, 6 Nov 2011 02:13:54 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C82929336; Sat, 5 Nov 2011 16:13:52 +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 XKFS3KFWbI39; Sat, 5 Nov 2011 16:13:51 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 85B93290FA; Sat, 5 Nov 2011 16:13:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 930762915E for ; Sat, 5 Nov 2011 16:13:25 +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 5N3DnuPSp1TC for ; Sat, 5 Nov 2011 16:13:25 +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 E9790290FA for ; Sat, 5 Nov 2011 16:13:24 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 438111C0F56C for ; Sat, 5 Nov 2011 16:13:23 +0100 (CET) X-Auth-Info: hu3WFGWWJnk5PhVcRSqV1w4SR56M2gsjCqYNSGlIyU8= 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 396BF1C001BD for ; Sat, 5 Nov 2011 16:13:23 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id 0C78BC913106 for ; Sat, 5 Nov 2011 16:13:23 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id E31D31893013; Sat, 5 Nov 2011 16:13:22 +0100 (CET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Sat, 5 Nov 2011 16:13:04 +0100 Message-Id: <1320505999-9770-8-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.7.6.4 In-Reply-To: <1320505999-9770-1-git-send-email-wd@denx.de> References: <1320458160-23136-1-git-send-email-wd@denx.de> <1320505999-9770-1-git-send-email-wd@denx.de> Subject: [U-Boot] [PATCH 07/22] common/cmd_flash.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: cmd_flash.c:355:32: warning: 'info' may be used uninitialized in this function [-Wuninitialized] cmd_flash.c:354:10: warning: 'sect_first' may be used uninitialized in this function [-Wuninitialized] cmd_flash.c:354:10: warning: 'sect_last' may be used uninitialized in this function [-Wuninitialized] cmd_flash.c: In function 'do_protect': cmd_flash.c:540:9: warning: 'info' may be used uninitialized in this function [-Wuninitialized] cmd_flash.c:538:9: warning: 'sect_first' may be used uninitialized in this function [-Wuninitialized] cmd_flash.c:538:9: warning: 'sect_last' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Wolfgang Denk --- common/cmd_flash.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/cmd_flash.c b/common/cmd_flash.c index 6765347..c6ea25a 100644 --- a/common/cmd_flash.c +++ b/common/cmd_flash.c @@ -324,9 +324,9 @@ int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { #ifndef CONFIG_SYS_NO_FLASH - flash_info_t *info; + flash_info_t *info = NULL; ulong bank, addr_first, addr_last; - int n, sect_first, sect_last; + int n, sect_first = 0, sect_last = 0; #if defined(CONFIG_CMD_MTDPARTS) struct mtd_device *dev; struct part_info *part; @@ -457,9 +457,9 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int rcode = 0; #ifndef CONFIG_SYS_NO_FLASH - flash_info_t *info; + flash_info_t *info = NULL; ulong bank; - int i, n, sect_first, sect_last; + int i, n, sect_first = 0, sect_last = 0; #if defined(CONFIG_CMD_MTDPARTS) struct mtd_device *dev; struct part_info *part;