From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] fs/direct-io.c: Fix compilation warning for uninitialized variables Date: Wed, 16 Jul 2014 10:58:03 -0700 Message-ID: <20140716175803.GA3631@infradead.org> References: <1404452632-10912-1-git-send-email-pramod.gurav.etc@gmail.com> <20140713115022.GA6054@infradead.org> <53C6B199.2070606@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , pramod.gurav.etc@gmail.com, viro@zeniv.linux.org.uk, Jason Cooper , Markus Mayer , Paul Bolle , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Boaz Harrosh Return-path: Content-Disposition: inline In-Reply-To: <53C6B199.2070606@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Jul 16, 2014 at 08:08:41PM +0300, Boaz Harrosh wrote: > This is the wrong fix. GCC is wrong here. As shown by Paul Bolle if > you move the from / to set from dio_get_page() to here the warning goes away. > > The minimal fix must use uninitialized_var() in this case. See patch below > > But I think the proper fix Is the one Paul Bolle sent (above) I don't think the initialization is wrong. The fix of moving the code defintively looks nicer, while I think uninitialized_var is horrible wart that won't get anywhere near my code. Either way we should merge one of those fixes ASAP..