* [PATCH] rtc: pfc8563: fix uninitialized variable warning
@ 2015-05-12 21:27 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2015-05-12 21:27 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Alessandro Zummo, rtc-linux, linux-arm-kernel, linux-kernel
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 <arnd@arndb.de>
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;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [rtc-linux] [PATCH] rtc: pfc8563: fix uninitialized variable warning
@ 2015-05-12 21:27 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2015-05-12 21:27 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Alessandro Zummo, rtc-linux, linux-arm-kernel, linux-kernel
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 <arnd@arndb.de>
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;
}
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] rtc: pfc8563: fix uninitialized variable warning
@ 2015-05-12 21:27 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2015-05-12 21:27 UTC (permalink / raw)
To: linux-arm-kernel
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 <arnd@arndb.de>
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;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] rtc: pfc8563: fix uninitialized variable warning
2015-05-12 21:27 ` [rtc-linux] " Arnd Bergmann
(?)
@ 2015-05-14 21:50 ` Alexandre Belloni
-1 siblings, 0 replies; 6+ messages in thread
From: Alexandre Belloni @ 2015-05-14 21:50 UTC (permalink / raw)
To: Andrew Morton
Cc: Arnd Bergmann, Alessandro Zummo, rtc-linux, linux-arm-kernel,
linux-kernel
Hi Andrew,
On 12/05/2015 at 23:27:02 +0200, Arnd Bergmann wrote :
> 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 <arnd@arndb.de>
> Fixes: a45d528aab8b ("rtc: pcf8563: clear expired alarm at boot time")
>
Can you send that fix to Linus for the next 4.1 rc?
You can add my
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
I hope that will be the last one :)
Thanks!
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [rtc-linux] Re: [PATCH] rtc: pfc8563: fix uninitialized variable warning
@ 2015-05-14 21:50 ` Alexandre Belloni
0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Belloni @ 2015-05-14 21:50 UTC (permalink / raw)
To: Andrew Morton
Cc: Arnd Bergmann, Alessandro Zummo, rtc-linux, linux-arm-kernel,
linux-kernel
Hi Andrew,
On 12/05/2015 at 23:27:02 +0200, Arnd Bergmann wrote :
> 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 <arnd@arndb.de>
> Fixes: a45d528aab8b ("rtc: pcf8563: clear expired alarm at boot time")
>
Can you send that fix to Linus for the next 4.1 rc?
You can add my
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
I hope that will be the last one :)
Thanks!
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] rtc: pfc8563: fix uninitialized variable warning
@ 2015-05-14 21:50 ` Alexandre Belloni
0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Belloni @ 2015-05-14 21:50 UTC (permalink / raw)
To: linux-arm-kernel
Hi Andrew,
On 12/05/2015 at 23:27:02 +0200, Arnd Bergmann wrote :
> 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 <arnd@arndb.de>
> Fixes: a45d528aab8b ("rtc: pcf8563: clear expired alarm at boot time")
>
Can you send that fix to Linus for the next 4.1 rc?
You can add my
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
I hope that will be the last one :)
Thanks!
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-14 21:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12 21:27 [PATCH] rtc: pfc8563: fix uninitialized variable warning Arnd Bergmann
2015-05-12 21:27 ` Arnd Bergmann
2015-05-12 21:27 ` [rtc-linux] " Arnd Bergmann
2015-05-14 21:50 ` Alexandre Belloni
2015-05-14 21:50 ` Alexandre Belloni
2015-05-14 21:50 ` [rtc-linux] " Alexandre Belloni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.