From patchwork Tue Jul 3 22:41:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 168856 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 BC5CF2C0080 for ; Wed, 4 Jul 2012 08:44:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 01A85280F1; Wed, 4 Jul 2012 00:44:08 +0200 (CEST) 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 S-sEFEqXMxSa; Wed, 4 Jul 2012 00:44:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D02DD280E6; Wed, 4 Jul 2012 00:44:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 58F11280E6 for ; Wed, 4 Jul 2012 00:44:03 +0200 (CEST) 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 1to+qK6cc7oW for ; Wed, 4 Jul 2012 00:44:02 +0200 (CEST) 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 ch1outboundpool.messaging.microsoft.com (ch1ehsobe002.messaging.microsoft.com [216.32.181.182]) by theia.denx.de (Postfix) with ESMTPS id 41945280C7 for ; Wed, 4 Jul 2012 00:44:00 +0200 (CEST) Received: from mail12-ch1-R.bigfish.com (10.43.68.238) by CH1EHSOBE002.bigfish.com (10.43.70.52) with Microsoft SMTP Server id 14.1.225.23; Tue, 3 Jul 2012 22:41:59 +0000 Received: from mail12-ch1 (localhost [127.0.0.1]) by mail12-ch1-R.bigfish.com (Postfix) with ESMTP id 19F6D100456; Tue, 3 Jul 2012 22:41:59 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzc89bhzz1202hzz8275ch8275bh8275dhz2dh2a8h668h839hd24he5bhf0ah) Received: from mail12-ch1 (localhost.localdomain [127.0.0.1]) by mail12-ch1 (MessageSwitch) id 13413553178052_8147; Tue, 3 Jul 2012 22:41:57 +0000 (UTC) Received: from CH1EHSMHS010.bigfish.com (snatpool2.int.messaging.microsoft.com [10.43.68.239]) by mail12-ch1.bigfish.com (Postfix) with ESMTP id EF82D80241; Tue, 3 Jul 2012 22:41:56 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS010.bigfish.com (10.43.70.10) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 3 Jul 2012 22:41:57 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.2.298.5; Tue, 3 Jul 2012 17:43:56 -0500 Received: from x9.am.freescale.net (x9.am.freescale.net [10.82.120.9]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id q63MhpSf019655; Tue, 3 Jul 2012 15:43:51 -0700 Date: Tue, 3 Jul 2012 17:41:56 -0500 From: Kim Phillips To: Andreas =?ISO-8859-1?Q?Bie=DFmann?= Message-ID: <20120703174156.a1082309c2b205216606a004@freescale.com> In-Reply-To: <4FF36E3C.4000808@googlemail.com> References: <1332945431-12441-1-git-send-email-u-boot@lakedaemon.net> <1338566090-15008-1-git-send-email-u-boot@lakedaemon.net> <20120621204947.21CBE202253@gemini.denx.de> <20120703110542.c8b827398ebcedf3448725e1@freescale.com> <4FF36E3C.4000808@googlemail.com> Organization: Freescale Semiconductor, Inc. X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: u-boot@lists.denx.de, reinhard.arlt@esd-electronics.com Subject: [U-Boot] [PATCH v2] ext2fs: fix warning: 'blocknxt' may be used uninitialized 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This warning was introduced in 436da3c "ext2load: increase read speed": ext2fs.c: In function 'ext2fs_read_file': ext2fs.c:458:19: warning: 'blocknxt' may be used uninitialized in this function [-Wuninitialized] this change makes it go away. Cc: Eric Nelson Cc: Thierry Reding Cc: Jason Cooper Cc: Andreas Bießmann Cc: Reinhard Arlt Signed-off-by: Kim Phillips Tested-by: Thierry Reding Acked-By: Jason Cooper --- v2: changed to Thierry's recommendation in: http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/134043 build-tested only - please ack fs/ext2/ext2fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext2/ext2fs.c b/fs/ext2/ext2fs.c index f1fce48..182f0ac 100644 --- a/fs/ext2/ext2fs.c +++ b/fs/ext2/ext2fs.c @@ -438,7 +438,7 @@ int ext2fs_read_file } /* grab middle blocks in one go */ - if (i != pos / blocksize && i != blockcnt - 1 && blockcnt > 3) { + if (i != pos / blocksize && i < blockcnt - 1 && blockcnt > 3) { int oldblk = blknr; int blocknxt; while (i < blockcnt - 1) {