From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751161AbcGMLhE (ORCPT ); Wed, 13 Jul 2016 07:37:04 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:46737 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbcGMLhB (ORCPT ); Wed, 13 Jul 2016 07:37:01 -0400 Date: Wed, 13 Jul 2016 14:36:57 +0300 From: Dan Carpenter To: Silvan Jegen Cc: Phillip Lougher , lkml , kernel-janitors@vger.kernel.org Subject: Re: [patch] Squashfs: silence some uninitialized variable warnings Message-ID: <20160713113657.GV32247@mwanda> References: <20160713100249.GB29468@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2016 at 01:29:32PM +0200, Silvan Jegen wrote: > Hi Dan > > On Wed, Jul 13, 2016 at 12:02 PM, Dan Carpenter > wrote: > > We print these values in the TRACE() code before we check that > > fill_meta_index() was successful. It makes my static checker complain. > > > > Signed-off-by: Dan Carpenter > > > > diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c > > index 13d8094..46679e2 100644 > > --- a/fs/squashfs/file.c > > +++ b/fs/squashfs/file.c > > @@ -334,9 +334,9 @@ failed: > > */ > > static int read_blocklist(struct inode *inode, int index, u64 *block) > > { > > - u64 start; > > + u64 start = -1; > > Do you assign the negative value to the unsigned variable here on purpose? > Yeah. It's just a garbage value but hopefully it would stand out in the printk. regards, dan carpenter