Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1284846 > unrolled thread

[PATCH 05/10] exynos4-is: Replace "hweight32(mask) == 1" with "is_power_of_2(mask)"

Started byZhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
First post2015-12-06 11:50 +0100
Last post2015-12-06 11:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 05/10] exynos4-is: Replace "hweight32(mask) == 1" with "is_power_of_2(mask)" Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com> - 2015-12-06 11:50 +0100

#1284846 — [PATCH 05/10] exynos4-is: Replace "hweight32(mask) == 1" with "is_power_of_2(mask)"

FromZhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
Date2015-12-06 11:50 +0100
Subject[PATCH 05/10] exynos4-is: Replace "hweight32(mask) == 1" with "is_power_of_2(mask)"
Message-ID<qCF3b-5NB-1@gated-at.bofh.it>
From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
---
 drivers/media/platform/exynos4-is/fimc-is-regs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-is-regs.c b/drivers/media/platform/exynos4-is/fimc-is-regs.c
index cfe4406..ec75a24 100644
--- a/drivers/media/platform/exynos4-is/fimc-is-regs.c
+++ b/drivers/media/platform/exynos4-is/fimc-is-regs.c
@@ -11,6 +11,7 @@
  * published by the Free Software Foundation.
  */
 #include <linux/delay.h>
+#include <linux/log2.h>
 
 #include "fimc-is.h"
 #include "fimc-is-command.h"
@@ -107,7 +108,7 @@ int fimc_is_hw_get_params(struct fimc_is *is, unsigned int num_args)
 
 void fimc_is_hw_set_isp_buf_mask(struct fimc_is *is, unsigned int mask)
 {
-	if (hweight32(mask) == 1) {
+	if (is_power_of_2(mask)) {
 		dev_err(&is->pdev->dev, "%s(): not enough buffers (mask %#x)\n",
 							__func__, mask);
 		return;
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web