lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <804c420eb23e70448c3c2c93f867a0eab3536bfd.1439187821.git.viresh.kumar@linaro.org>
Date:	Mon, 10 Aug 2015 12:01:58 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Rafael Wysocki <rjw@...ysocki.net>, nm@...com, sboyd@...eaurora.org
Cc:	linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
	khilman@...aro.org, Viresh Kumar <viresh.kumar@...aro.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Len Brown <len.brown@...el.com>,
	linux-kernel@...r.kernel.org (open list),
	Pavel Machek <pavel@....cz>
Subject: [PATCH 2/6] PM / OPP: restructure _of_init_opp_table_v2()

'dev_opp' will always be NULL in _of_init_opp_table_v2() after creating
OPPs for a device. There is no point comparing it against NULL there.

Restructure code a bit to make it more efficient.

Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
---
 drivers/base/power/opp.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 1daaa1a418a2..c9747fb192b1 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -1295,20 +1295,19 @@ static int _of_init_opp_table_v2(struct device *dev,
 	if (WARN_ON(!count))
 		goto out;
 
-	if (!ret) {
-		if (!dev_opp) {
-			dev_opp = _find_device_opp(dev);
-			if (WARN_ON(!dev_opp))
-				goto out;
-		}
-
-		dev_opp->np = opp_np;
-		dev_opp->shared_opp = of_property_read_bool(opp_np,
-							    "opp-shared");
-	} else {
+	if (ret) {
 		of_free_opp_table(dev);
+		goto out;
 	}
 
+	dev_opp = _find_device_opp(dev);
+	if (WARN_ON(!dev_opp))
+		goto out;
+
+	dev_opp->np = opp_np;
+	dev_opp->shared_opp = of_property_read_bool(opp_np,
+			"opp-shared");
+
 out:
 	return ret;
 }
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ