linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / domains: Fix 'may be used uninitialized' build warning
@ 2016-12-30 11:34 Augusto Mecking Caringi
  2017-01-06  1:28 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Augusto Mecking Caringi @ 2016-12-30 11:34 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: torvalds, Augusto Mecking Caringi, Kevin Hilman, Ulf Hansson,
	Len Brown, Pavel Machek, Greg Kroah-Hartman, linux-pm,
	linux-kernel

This patch fixes the following gcc warning:

drivers/base/power/domain.c: In function ‘genpd_runtime_resume’:
drivers/base/power/domain.c:642:14: warning: ‘time_start’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
   elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start)

The same problem (in another function in this same file) was fixed in
commit d33d5a6c88fc (avoid spurious "may be used uninitialized" warning)

Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com>
---
 drivers/base/power/domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index a5e1262..2997026 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -626,6 +626,7 @@ static int genpd_runtime_resume(struct device *dev)
 
  out:
 	/* Measure resume latency. */
+	time_start = 0;
 	if (timed && runtime_pm)
 		time_start = ktime_get();
 
-- 
2.7.4


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

end of thread, other threads:[~2017-01-06  1:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-30 11:34 [PATCH] PM / domains: Fix 'may be used uninitialized' build warning Augusto Mecking Caringi
2017-01-06  1:28 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).