Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759689AbcJRJmd (ORCPT ); Tue, 18 Oct 2016 05:42:33 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:45080 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759598AbcJRJmJ (ORCPT ); Tue, 18 Oct 2016 05:42:09 -0400 Date: Tue, 18 Oct 2016 10:42:00 +0100 From: Russell King - ARM Linux To: Arnd Bergmann Cc: Linus Torvalds , linux-kernel@vger.kernel.org, linux-pcmcia@lists.infradead.org Subject: Re: [PATCH 16/28] pcmcia: fix return value of soc_pcmcia_regulator_set Message-ID: <20161018094159.GK1041@n2100.armlinux.org.uk> References: <20161017220342.1627073-1-arnd@arndb.de> <20161017221355.1861551-4-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161017221355.1861551-4-arnd@arndb.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1231 Lines: 25 On Tue, Oct 18, 2016 at 12:13:37AM +0200, Arnd Bergmann wrote: > The newly introduced soc_pcmcia_regulator_set() function sometimes returns > without setting its return code, as shown by this warning: > > drivers/pcmcia/soc_common.c: In function 'soc_pcmcia_regulator_set': > drivers/pcmcia/soc_common.c:112:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > This changes it to propagate the regulator_disable() result instead. I guess this is the problem with the stupid patch which silences this warning - I don't see this warning here. Having this warning disabled means that _real_ coding errors end up making their way into the kernel (yes, this should be an error, this is not a warning, because the value of 'ret' is completely undefined, and therefore the behaviour of the following code is undefined.) With the warning silenced, it means that such errors are undetectable. I knew nothing about this until I received this patch, and I always check that the code I send is warning-free on the GCC I'm using. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.