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: <1449396705-14235-1-git-send-email-zhaoxiu.zeng@gmail.com>
Date:	Sun,  6 Dec 2015 18:11:45 +0800
From:	Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
To:	computersforpeace@...il.com, gregory.0xf0@...il.com,
	f.fainelli@...il.com, linux-arm-kernel@...ts.infradead.org
Cc:	linux-kernel@...r.kernel.org, Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>
Subject: [PATCH 02/10] brcmstb_gisb: Replace "hweight_long(mask) != 1" with "!is_power_of_2(mask)"

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

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

diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
index f364fa4..2816a04 100644
--- a/drivers/bus/brcmstb_gisb.c
+++ b/drivers/bus/brcmstb_gisb.c
@@ -24,6 +24,7 @@
 #include <linux/of.h>
 #include <linux/bitops.h>
 #include <linux/pm.h>
+#include <linux/log2.h>
 
 #ifdef CONFIG_ARM
 #include <asm/bug.h>
@@ -171,7 +172,7 @@ brcmstb_gisb_master_to_str(struct brcmstb_gisb_arb_device *gdev,
 {
 	u32 mask = gdev->valid_mask & masters;
 
-	if (hweight_long(mask) != 1)
+	if (!is_power_of_2(mask))
 		return NULL;
 
 	return gdev->master_names[ffs(mask) - 1];
-- 
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