[PATCH 04/10] omap_hwspinlock: Replace "hweight_long(i & 0xf) != 1" with "!is_power_of_2(i & 0xf)"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zeng Zhaoxiu <zhaoxiu.zeng@xxxxxxxxx>

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@xxxxxxxxx>
---
 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-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux