From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755410AbcB1WDb (ORCPT ); Sun, 28 Feb 2016 17:03:31 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:64783 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755040AbcB1WD3 (ORCPT ); Sun, 28 Feb 2016 17:03:29 -0500 From: Arnd Bergmann To: Sergei Ianovich Cc: linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] spi: lp-8841: return correct error code from probe Date: Sun, 28 Feb 2016 23:03:01 +0100 Message-ID: <4810940.iqjRTUDvFQ@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1456601577.23036.60.camel@gmail.com> References: <1456400265-3068525-1-git-send-email-arnd@arndb.de> <1456601577.23036.60.camel@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:wNpbLPVy7WvCydfRlQIL3phYFr/8wIlhS9N65pUOsh+KoH4l3WH RoTuK/rFBmW2LUzOQhaIWuFLnhNv5Q2H2zoBZRmXUmYLqcYnt1ddv6+W/x0TwHVmzUQwfMl g0m7uYs0JUsCetuefEMWiwJ9nkVKad5KTkCZLtbd1tAe/PthrAHMrDeMMygMJGUkoR1DlJV fVbScicSBm6HybSJwTajg== X-UI-Out-Filterresults: notjunk:1;V01:K0:UMklci9xz8A=:b5twRxpMVCbWOPfDUwR9uT 9M02/sCGO7Ed+bj6GNh2qdiXS3FiDfRK+jUQm0SKL09XH0rDWSD9yrxcbgOgzGI2HaifYfNtm h/jS2OiJNIjTQKE3hV5Z71y6wodgtg1naHeIp9VmcbXOogBbmQfds2VuG3psi5m3jahxierA5 jENJ0TDYGK7IzPyIFZp85cpDiQz/f2ap6Fm9A+ZNbJ2iPoSj1363R2ZrJsL9vYmMQ1E3j0+TL tktoj5bch3VRx7kxfvReA0jqE0KnUYrhkmkcgnoZ7eSoSeK67ksG7qDqX1tGZCuM1ZJ6/s+Sh IPUdL25VSd3dI7kucasduRgddIPfH9MiIH8WtRRHpQfu1bfHuvJCaUMhQk0e1fw5qC/dPJEEG APhZ6G+zYJ75u/uDJMDMDjOTBo4B5aA2EgL5H+dEF/EQGVeVZ5h4hHZ83SOt0y05sYc0J/V0w M3mS7wsL3bLOFNSy3JaKD/gAdV4bZYIndUvnBIFMgIWK7u+zLZkB9skFMArCU/3FJsQRl/Zx3 I3qk4hrpPh13CiCQMZOHGJWtEg2JTcrbxAAJjPSpfYYapQwu7PlnI0gLdonpNg9YouGNZPcWk hhQ1fT3VZ5sYJ1gUrLgOY4hKvtImw2QYtBz2f4TPPvSoAVbKr6P/NMdEhF0U81DLPvd530B84 hfJJe2J7CniPcLAp/Gp4HaemBQRcT9hJEc4kD0iHxqlhgOR1genv2UyJrbV4wdheeHpxNSINQ aZd69nG90Emxm4tE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday 27 February 2016 22:32:57 Sergei Ianovich wrote: > Hi Arnd, > > On Thu, 2016-02-25 at 12:37 +0100, Arnd Bergmann wrote: > > The spi_lp8841_rtc_probe() function misses an initialization of the > > return code when it fails to get its memory resource, as gcc notices: > > > > drivers/spi/spi-lp8841-rtc.c: In function 'spi_lp8841_rtc_probe': > > drivers/spi/spi-lp8841-rtc.c:239:9: error: 'ret' may be used > > uninitialized in this function [-Werror=maybe-uninitialized] > > I wasn't getting this warning when I was building the driver. This > happened because -Wmaybe-uninitialized is suppressed when > CONFIG_CC_OPTIMIZE_FOR_SIZE is selected > (Commit e74fc973b6e531fef1fce8b101ffff05ecfb774c "Turn off -Wmaybe- > uninitialized when building with -Os"). > > A recent gcc version like 5.3.1 doesn't seem to produce much false > positives. May it make sense to revert that commit? > > The gcc-5.3.1 log for reference. I have spent a lot of time on fixing those warning messages. I still see tons of warnings even with the latest compilers when -Os (all false positives) is used, and I have a branch in which I have fixed all the ones that happen when building with -O2. I recently submitted a patch to turn CONFIG_CC_OPTIMIZE_FOR_SIZE into a choice statement that is not automatically set on an allmodconfig build, which should help here, but my patch has not yet been merged. We have similar problems with a couple of other options that drastically increase the false positive rate for these warnings (GCOV_PROFILE_ALL, PROFILE_ALL_BRANCHES, UBSAN_SANTIZE_ALL, ...), and I think our best strategy for all of these is to make sure they are not enabled in an allmodconfig build or the typical defconfigs, but also to hide the warnings if they are used in a particular config. Arnd