PM / OPP: silence an uninitialized variable warning
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 16 May 2018 09:52:41 +0000 (12:52 +0300)
committerViresh Kumar <viresh.kumar@linaro.org>
Wed, 16 May 2018 09:55:44 +0000 (15:25 +0530)
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.

Fixes: a1e8c13600bf ("PM / OPP: "opp-hz" is optional for power domains")
[ Viresh: Added the Fixes tag ]
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/of.c

index 7026e9f484eaa5011c4512be340d858a3775452c..6d15f05bfc28ec9b94b04ff569128779ce93331d 100644 (file)
@@ -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;