From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751661AbdALL2c (ORCPT ); Thu, 12 Jan 2017 06:28:32 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:43051 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751248AbdALL2b (ORCPT ); Thu, 12 Jan 2017 06:28:31 -0500 Date: Thu, 12 Jan 2017 12:28:18 +0100 From: Alexandre Belloni To: Arnd Bergmann Cc: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Alessandro Zummo , linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: armada38x: hide maybe-uninitialized warning Message-ID: <20170112112818.q2gxfgw7j3alo2ln@piout.net> References: <20170111145112.722743-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170111145112.722743-1-arnd@arndb.de> User-Agent: NeoMutt/20161126 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On 11/01/2017 at 15:50:31 +0100, Arnd Bergmann wrote : > The function is too complicated for gcc to realize that this variable > does eventually get initialized, causing a harmless warning: > > drivers/rtc/rtc-armada38x.c: In function 'read_rtc_register_wa': > drivers/rtc/rtc-armada38x.c:131:25: warning: 'index_max' may be used uninitialized in this function [-Wmaybe-uninitialized] > > This adds an explicit initializion at the start of the function. > I generally try to avoid that, but it seems appropriate here, > as we start out with max=0 as well. > > Fixes: 61cffa2438e3 ("rtc: armada38x: Follow the new recommendation for errata implementation") > Signed-off-by: Arnd Bergmann Actually, I fixed that one directly in the commit yesterday as it has been reported to me multiple times already. -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com