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:	Sun,  6 Dec 2015 17:42:22 +0800
From:	Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
To:	linux-sh@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>
Subject: [PATCH 01/10] sh: Replace "hweight_long(flags) != 1" with "!is_power_of_2(flags)"

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

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@...il.com>
---
 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

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