mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
To: computersforpeace@gmail.com, gregory.0xf0@gmail.com,
	f.fainelli@gmail.com, linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
Subject: [PATCH 02/10] brcmstb_gisb: Replace "hweight_long(mask) != 1" with "!is_power_of_2(mask)"
Date: Sun,  6 Dec 2015 18:11:45 +0800	[thread overview]
Message-ID: <1449396705-14235-1-git-send-email-zhaoxiu.zeng@gmail.com> (raw)

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

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


             reply	other threads:[~2015-12-06 10:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 10:11 Zhaoxiu Zeng [this message]
2015-12-14 19:55 ` Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449396705-14235-1-git-send-email-zhaoxiu.zeng@gmail.com \
    --to=zhaoxiu.zeng@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregory.0xf0@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®