From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: PATCH v2] PM / OPP: silence an uninitialized variable warning
Date: Wed, 16 May 2018 09:52:41 +0000 [thread overview]
Message-ID: <20180516095241.GA27540@mwanda> (raw)
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;
next reply other threads:[~2018-05-16 9:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-16 9:52 Dan Carpenter [this message]
2018-05-16 10:12 ` PATCH v2] PM / OPP: silence an uninitialized variable warning Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180516095241.GA27540@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.