From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934000AbbELV1K (ORCPT ); Tue, 12 May 2015 17:27:10 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:58441 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933051AbbELV1H (ORCPT ); Tue, 12 May 2015 17:27:07 -0400 From: Arnd Bergmann To: Alexandre Belloni Cc: Alessandro Zummo , rtc-linux@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtc: pfc8563: fix uninitialized variable warning Date: Tue, 12 May 2015 23:27:02 +0200 Message-ID: <2293546.ekQV1ek12O@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Z67a6OZTfQNSTUBm5eLCUV9idMMg3LJNYAh6t6scdINIf8Qn5aY hoHa7q4VU/wQEfxguwT3PyGEu6r8sfy5Don+zo9X+5VKoVrVx4WP1e7TGd81Qsbp85F/sDS /Cg8qZcGEWDpNS2osJnyv7C6r8D/F4mfLVTZYuBN0KkRPdx6tVnoCWz5C6O1hRA51R5jB2Z Y7sB9+Q0+cLzQZ98MMAwQ== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Gcc is unable to prove that alm_pending is always initialized when it is used, so it prints a harmless warning: drivers/rtc/rtc-pcf8563.c: In function 'pcf8563_probe': drivers/rtc/rtc-pcf8563.c:449:5: warning: 'alm_pending' may be used uninitialized in this function [-Wmaybe-uninitialized] This uses the same conditional expression that is used inside of the pcf8563_get_alarm_mode() function, to help gcc figure it out and shut up that warning, and make the ARM defconfigs build again with no warnings. Signed-off-by: Arnd Bergmann Fixes: a45d528aab8b ("rtc: pcf8563: clear expired alarm at boot time") diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index 0ba7e59929be..8e52c029cf1a 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c @@ -437,7 +437,7 @@ static int pcf8563_probe(struct i2c_client *client, } err = pcf8563_get_alarm_mode(client, NULL, &alm_pending); - if (err < 0) { + if (err) { dev_err(&client->dev, "%s: read error\n", __func__); return err; }