Thread (2 messages) flat view 2 messages, 2 authors, 2015-12-14
STALE3904d

[PATCH 02/10] brcmstb_gisb: Replace "hweight_long(mask) != 1" with "!is_power_of_2(mask)"

From: Zhaoxiu Zeng <hidden>
Date: 2015-12-06 10:13:02
Also in: lkml
Subsystem: broadcom bcm7xxx arm architecture, the rest · Maintainers: Florian Fainelli, Linus Torvalds

From: Zeng Zhaoxiu <redacted>

Signed-off-by: Zeng Zhaoxiu <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help