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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1449398006-14450-1-git-send-email-zhaoxiu.zeng@gmail.com>
Date:	Sun,  6 Dec 2015 18:33:26 +0800
From:	Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
To:	ohad@...ery.com, linux-omap@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>
Subject: [PATCH 04/10] omap_hwspinlock: Replace "hweight_long(i & 0xf) != 1" with "!is_power_of_2(i & 0xf)"

From: Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>
---
 drivers/hwspinlock/omap_hwspinlock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
index ad2f8ca..1848a4c 100644
--- a/drivers/hwspinlock/omap_hwspinlock.c
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -29,6 +29,7 @@
 #include <linux/hwspinlock.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/log2.h>
 
 #include "hwspinlock_internal.h"
 
@@ -125,7 +126,7 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
 		goto iounmap_base;
 
 	/* one of the four lsb's must be set, and nothing else */
-	if (hweight_long(i & 0xf) != 1 || i > 8) {
+	if (!is_power_of_2(i & 0xf) || i > 8) {
 		ret = -EINVAL;
 		goto iounmap_base;
 	}
-- 
2.5.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