[PATCH 01/10] sh: Replace "hweight_long(flags) != 1" with "!is_power_of_2(flags)"

DORMANTno replies

From: Zhaoxiu Zeng <hidden>
Date: 2015-12-06 09:58:18
Also in: lkml
Subsystem: superh, the rest · Maintainers: Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz, Linus Torvalds

From: Zeng Zhaoxiu <redacted>

Signed-off-by: Zeng Zhaoxiu <redacted>
---
 arch/sh/kernel/io_trapped.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
index f8ce362..d8f32bf 100644
--- a/arch/sh/kernel/io_trapped.c
+++ b/arch/sh/kernel/io_trapped.c
@@ -15,6 +15,7 @@
 #include <linux/vmalloc.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/log2.h>
 #include <asm/mmu_context.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -62,7 +63,7 @@ int register_trapped_io(struct trapped_io *tiop)
 	}
 
 	/* support IORESOURCE_IO _or_ MEM, not both */
-	if (hweight_long(flags) != 1)
+	if (!is_power_of_2(flags))
 		goto bad;
 
 	n = len >> PAGE_SHIFT;
-- 
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