All of lore.kernel.org
 help / color / mirror / Atom feed
* PATCH v2] PM / OPP: silence an uninitialized variable warning
@ 2018-05-16  9:52 Dan Carpenter
  2018-05-16 10:12 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-05-16  9:52 UTC (permalink / raw)
  To: kernel-janitors

Smatch complains that it's possible we print "rate" in the debug output
when it hasn't been initialized.  It should be zero on that path.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: fix it a different way

diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 7026e9f484ea..6d15f05bfc28 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -287,7 +287,7 @@ static int _opp_add_static_v2(struct opp_table *opp_table, struct device *dev,
 			      struct device_node *np)
 {
 	struct dev_pm_opp *new_opp;
-	u64 rate;
+	u64 rate = 0;
 	u32 val;
 	int ret;
 	bool rate_not_available = false;

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

end of thread, other threads:[~2018-05-16 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-16  9:52 PATCH v2] PM / OPP: silence an uninitialized variable warning Dan Carpenter
2018-05-16 10:12 ` Viresh Kumar

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.