From patchwork Wed May 16 09:52:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10403223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4C396601C8 for ; Wed, 16 May 2018 09:53:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37756201A4 for ; Wed, 16 May 2018 09:53:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28C802884B; Wed, 16 May 2018 09:53:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0AC628821 for ; Wed, 16 May 2018 09:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753231AbeEPJw4 (ORCPT ); Wed, 16 May 2018 05:52:56 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:56596 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751533AbeEPJwy (ORCPT ); Wed, 16 May 2018 05:52:54 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4G9omji193010; Wed, 16 May 2018 09:52:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=i7+KL7uGPi+ANACVEIsB1+RZozdR0sWLQ3oyERKSCa4=; b=e1NL6djjQ5TA5O5DDVNCA4ak/4u0i6cF6OqVsJt8uN5YJ8EJOb4noXy59sdHf6EFLzM4 qsBQYhBASUHBRxISkq7OXiAZq/jLZv3oO/u2mRB8utdUi5cKS/y3r7zS0UIfFPK6ys6B E6NwfhWiq8hADeriBFRW9xX1srOQXMTqFb8wtFytDQPQwr6iGvGgOOvaAGVairbak8gq mpv01B9GDNOQzAKY75vmsh1/RkSWN3FBiZh7a7hsvwaX6F8RK8DRjoKBtAqwDIAJIl/L njXM1YGIe1c+QhFQsuS/FjK63dohn5ikV7RZJOtf/KTnau9nU36bTAPOJhJynwP9nS+0 2Q== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2hx29wc34m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 May 2018 09:52:50 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4G9qmvM008260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 May 2018 09:52:49 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4G9qmRW022724; Wed, 16 May 2018 09:52:48 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 16 May 2018 02:52:47 -0700 Date: Wed, 16 May 2018 12:52:41 +0300 From: Dan Carpenter To: Viresh Kumar Cc: Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: PATCH v2] PM / OPP: silence an uninitialized variable warning Message-ID: <20180516095241.GA27540@mwanda> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180516093233.kdfira3zmvj6qyox@vireshk-i7> X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8894 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=973 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805160100 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;