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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 23 Nov 2015 16:39:05 +0530
From:	Saurabh Sengar <saurabh.truth@...il.com>
To:	ssantosh@...nel.org, linux-kernel@...r.kernel.org
Cc:	Saurabh Sengar <saurabh.truth@...il.com>
Subject: [PATCH] memory: emif: use of_property_read_u32()

use of_property_read_u32(), it will save few steps and variables

Signed-off-by: Saurabh Sengar <saurabh.truth@...il.com>
---
 drivers/memory/emif.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c
index 04644e7..52a9ad1 100644
--- a/drivers/memory/emif.c
+++ b/drivers/memory/emif.c
@@ -1262,11 +1262,10 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
 		struct emif_data *emif)
 {
 	struct emif_custom_configs	*cust_cfgs = NULL;
-	int				len;
-	const __be32			*lpmode, *poll_intvl;
+	u32				lpmode = 0, poll_intvl = 0;
 
-	lpmode = of_get_property(np_emif, "low-power-mode", &len);
-	poll_intvl = of_get_property(np_emif, "temp-alert-poll-interval", &len);
+	of_property_read_u32(np_emif, "low-power-mode", &lpmode);
+	of_property_read_u32(np_emif, "temp-alert-poll-interval", &poll_intvl);
 
 	if (lpmode || poll_intvl)
 		cust_cfgs = devm_kzalloc(emif->dev, sizeof(*cust_cfgs),
@@ -1277,7 +1276,7 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
 
 	if (lpmode) {
 		cust_cfgs->mask |= EMIF_CUSTOM_CONFIG_LPMODE;
-		cust_cfgs->lpmode = be32_to_cpup(lpmode);
+		cust_cfgs->lpmode = lpmode;
 		of_property_read_u32(np_emif,
 				"low-power-mode-timeout-performance",
 				&cust_cfgs->lpmode_timeout_performance);
@@ -1292,11 +1291,10 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
 	if (poll_intvl) {
 		cust_cfgs->mask |=
 				EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL;
-		cust_cfgs->temp_alert_poll_interval_ms =
-						be32_to_cpup(poll_intvl);
+		cust_cfgs->temp_alert_poll_interval_ms = poll_intvl;
 	}
 
-	if (of_find_property(np_emif, "extended-temp-part", &len))
+	if (of_find_property(np_emif, "extended-temp-part", NULL))
 		cust_cfgs->mask |= EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART;
 
 	if (!is_custom_config_valid(cust_cfgs, emif->dev)) {
-- 
1.9.1

--
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