mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rtc: palmas: Initialise bb_charging flag before using it
@ 2015-05-29 12:14 Laxman Dewangan
  2015-06-08 19:04 ` [rtc-linux] " Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Laxman Dewangan @ 2015-05-29 12:14 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni, akpm; +Cc: rtc-linux, linux-kernel, Laxman Dewangan

Initialise the variable high_bb_charging before using it to avoid
configuring wrong value and fix following compilation warning:

/*
rtc-palmas.c: In function ‘palmas_rtc_probe’:
rtc-palmas.c:242:7: warning: ‘high_bb_charging’ may be used
uninitialized in this function
*/

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 drivers/rtc/rtc-palmas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-palmas.c b/drivers/rtc/rtc-palmas.c
index 3b01d56..7ea2c47 100644
--- a/drivers/rtc/rtc-palmas.c
+++ b/drivers/rtc/rtc-palmas.c
@@ -239,7 +239,7 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 	struct palmas_rtc *palmas_rtc = NULL;
 	int ret;
 	bool enable_bb_charging = false;
-	bool high_bb_charging;
+	bool high_bb_charging = false;
 
 	if (pdev->dev.of_node) {
 		enable_bb_charging = of_property_read_bool(pdev->dev.of_node,
-- 
2.1.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: palmas: Initialise bb_charging flag before using it
  2015-05-29 12:14 [PATCH] rtc: palmas: Initialise bb_charging flag before using it Laxman Dewangan
@ 2015-06-08 19:04 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2015-06-08 19:04 UTC (permalink / raw)
  To: Laxman Dewangan; +Cc: a.zummo, akpm, rtc-linux, linux-kernel

On 29/05/2015 at 17:44:05 +0530, Laxman Dewangan wrote :
> Initialise the variable high_bb_charging before using it to avoid
> configuring wrong value and fix following compilation warning:
> 
> /*
> rtc-palmas.c: In function ‘palmas_rtc_probe’:
> rtc-palmas.c:242:7: warning: ‘high_bb_charging’ may be used
> uninitialized in this function
> */
> 

I didn't find a way to get that warning and I'm interested to know how
you got it.

I've applied the patch anyway.

> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-08 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-29 12:14 [PATCH] rtc: palmas: Initialise bb_charging flag before using it Laxman Dewangan
2015-06-08 19:04 ` [rtc-linux] " Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®