From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756939AbcJXAy4 (ORCPT ); Sun, 23 Oct 2016 20:54:56 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:33212 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756558AbcJXAyx (ORCPT ); Sun, 23 Oct 2016 20:54:53 -0400 MIME-Version: 1.0 In-Reply-To: <20161017221650.1902729-7-arnd@arndb.de> References: <20161017220342.1627073-1-arnd@arndb.de> <20161017221650.1902729-7-arnd@arndb.de> From: Ley Foon Tan Date: Mon, 24 Oct 2016 08:54:52 +0800 X-Google-Sender-Auth: 8yUvVhBiLsv2zsdL6dwPwRJIKJU Message-ID: Subject: Re: [PATCH 26/28] nios2: fix timer initcall return value To: Arnd Bergmann Cc: Linus Torvalds , "linux-kernel@vger.kernel.org" , Daniel Lezcano , "nios2-dev@lists.rocketboards.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 18, 2016 at 6:16 AM, Arnd Bergmann wrote: > When called more than twice, the nios2_time_init() function > return an uninitialized value, as detected by gcc -Wmaybe-uninitialized > > arch/nios2/kernel/time.c: warning: 'ret' may be used uninitialized in this function > > This makes it return '0' here, matching the comment above the > function. > > Signed-off-by: Arnd Bergmann > --- > arch/nios2/kernel/time.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/nios2/kernel/time.c b/arch/nios2/kernel/time.c > index d9563dd..746bf5c 100644 > --- a/arch/nios2/kernel/time.c > +++ b/arch/nios2/kernel/time.c > @@ -324,6 +324,7 @@ static int __init nios2_time_init(struct device_node *timer) > ret = nios2_clocksource_init(timer); > break; > default: > + ret = 0; > break; > } Acked-by: Ley Foon Tan