All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] sched: Use for_each_bit
@ 2010-01-31 11:53 Akinobu Mita
  2010-01-31 11:53 ` [PATCH 2/7] bitmap: " Akinobu Mita
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Akinobu Mita @ 2010-01-31 11:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Akinobu Mita, Ingo Molnar, Peter Zijlstra

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
---
 kernel/sched_cpupri.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/kernel/sched_cpupri.c b/kernel/sched_cpupri.c
index 597b330..eeb3506 100644
--- a/kernel/sched_cpupri.c
+++ b/kernel/sched_cpupri.c
@@ -47,9 +47,7 @@ static int convert_prio(int prio)
 }
 
 #define for_each_cpupri_active(array, idx)                    \
-  for (idx = find_first_bit(array, CPUPRI_NR_PRIORITIES);     \
-       idx < CPUPRI_NR_PRIORITIES;                            \
-       idx = find_next_bit(array, CPUPRI_NR_PRIORITIES, idx+1))
+	for_each_bit(idx, array, CPUPRI_NR_PRIORITIES)
 
 /**
  * cpupri_find - find the best (lowest-pri) CPU in the system
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/7] bitmap: Use for_each_bit
  2010-01-31 11:53 [PATCH 1/7] sched: Use for_each_bit Akinobu Mita
@ 2010-01-31 11:53 ` Akinobu Mita
  2010-01-31 11:53 ` [PATCH 3/7] phonet: " Akinobu Mita
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Akinobu Mita @ 2010-01-31 11:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Akinobu Mita

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 lib/bitmap.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/lib/bitmap.c b/lib/bitmap.c
index 11bf497..84292c9 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -733,10 +733,9 @@ void bitmap_remap(unsigned long *dst, const unsigned long *src,
 	bitmap_zero(dst, bits);
 
 	w = bitmap_weight(new, bits);
-	for (oldbit = find_first_bit(src, bits);
-	     oldbit < bits;
-	     oldbit = find_next_bit(src, bits, oldbit + 1)) {
+	for_each_bit(oldbit, src, bits) {
 	     	int n = bitmap_pos_to_ord(old, oldbit, bits);
+
 		if (n < 0 || w == 0)
 			set_bit(oldbit, dst);	/* identity map */
 		else
@@ -903,9 +902,7 @@ void bitmap_onto(unsigned long *dst, const unsigned long *orig,
 	 */
 
 	m = 0;
-	for (n = find_first_bit(relmap, bits);
-	     n < bits;
-	     n = find_next_bit(relmap, bits, n + 1)) {
+	for_each_bit(n, relmap, bits) {
 		/* m == bitmap_pos_to_ord(relmap, n, bits) */
 		if (test_bit(m, orig))
 			set_bit(n, dst);
@@ -934,9 +931,7 @@ void bitmap_fold(unsigned long *dst, const unsigned long *orig,
 		return;
 	bitmap_zero(dst, bits);
 
-	for (oldbit = find_first_bit(orig, bits);
-	     oldbit < bits;
-	     oldbit = find_next_bit(orig, bits, oldbit + 1))
+	for_each_bit(oldbit, orig, bits)
 		set_bit(oldbit % sz, dst);
 }
 EXPORT_SYMBOL(bitmap_fold);
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/7] phonet: Use for_each_bit
  2010-01-31 11:53 [PATCH 1/7] sched: Use for_each_bit Akinobu Mita
  2010-01-31 11:53 ` [PATCH 2/7] bitmap: " Akinobu Mita
@ 2010-01-31 11:53 ` Akinobu Mita
  2010-01-31 11:53 ` [PATCH 4/7] intel-iommu: " Akinobu Mita
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Akinobu Mita @ 2010-01-31 11:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Akinobu Mita, David S. Miller, netdev

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
 net/phonet/pn_dev.c     |    3 +--
 net/phonet/pn_netlink.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index bc4a33b..52edfc4 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -107,8 +107,7 @@ static void phonet_device_destroy(struct net_device *dev)
 	if (pnd) {
 		u8 addr;
 
-		for (addr = find_first_bit(pnd->addrs, 64); addr < 64;
-			addr = find_next_bit(pnd->addrs, 64, 1+addr))
+		for_each_bit(addr, pnd->addrs, 64)
 			phonet_address_notify(RTM_DELADDR, dev, addr);
 		kfree(pnd);
 	}
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c
index 2e6c7eb..4edc048 100644
--- a/net/phonet/pn_netlink.c
+++ b/net/phonet/pn_netlink.c
@@ -141,8 +141,7 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
 			continue;
 
 		addr_idx = 0;
-		for (addr = find_first_bit(pnd->addrs, 64); addr < 64;
-			addr = find_next_bit(pnd->addrs, 64, 1+addr)) {
+		for_each_bit(addr, pnd->addrs, 64) {
 			if (addr_idx++ < addr_start_idx)
 				continue;
 
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/7] intel-iommu: Use for_each_bit
  2010-01-31 11:53 [PATCH 1/7] sched: Use for_each_bit Akinobu Mita
  2010-01-31 11:53 ` [PATCH 2/7] bitmap: " Akinobu Mita
  2010-01-31 11:53 ` [PATCH 3/7] phonet: " Akinobu Mita
@ 2010-01-31 11:53 ` Akinobu Mita
  2010-01-31 11:53 ` [PATCH 5/7] infiniband: " Akinobu Mita
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Akinobu Mita @ 2010-01-31 11:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Akinobu Mita, David Woodhouse, iommu

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: iommu@lists.linux-foundation.org
---
 drivers/pci/intel-iommu.c |   33 +++++++--------------------------
 1 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 4173125..7768bf8 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -491,13 +491,11 @@ static void domain_update_iommu_coherency(struct dmar_domain *domain)
 
 	domain->iommu_coherency = 1;
 
-	i = find_first_bit(&domain->iommu_bmp, g_num_of_iommus);
-	for (; i < g_num_of_iommus; ) {
+	for_each_bit(i, &domain->iommu_bmp, g_num_of_iommus) {
 		if (!ecap_coherent(g_iommus[i]->ecap)) {
 			domain->iommu_coherency = 0;
 			break;
 		}
-		i = find_next_bit(&domain->iommu_bmp, g_num_of_iommus, i+1);
 	}
 }
 
@@ -507,13 +505,11 @@ static void domain_update_iommu_snooping(struct dmar_domain *domain)
 
 	domain->iommu_snooping = 1;
 
-	i = find_first_bit(&domain->iommu_bmp, g_num_of_iommus);
-	for (; i < g_num_of_iommus; ) {
+	for_each_bit(i, &domain->iommu_bmp, g_num_of_iommus) {
 		if (!ecap_sc_support(g_iommus[i]->ecap)) {
 			domain->iommu_snooping = 0;
 			break;
 		}
-		i = find_next_bit(&domain->iommu_bmp, g_num_of_iommus, i+1);
 	}
 }
 
@@ -1194,8 +1190,7 @@ void free_dmar_iommu(struct intel_iommu *iommu)
 	unsigned long flags;
 
 	if ((iommu->domains) && (iommu->domain_ids)) {
-		i = find_first_bit(iommu->domain_ids, cap_ndoms(iommu->cap));
-		for (; i < cap_ndoms(iommu->cap); ) {
+		for_each_bit(i, iommu->domain_ids, cap_ndoms(iommu->cap)) {
 			domain = iommu->domains[i];
 			clear_bit(i, iommu->domain_ids);
 
@@ -1207,9 +1202,6 @@ void free_dmar_iommu(struct intel_iommu *iommu)
 					domain_exit(domain);
 			}
 			spin_unlock_irqrestore(&domain->iommu_lock, flags);
-
-			i = find_next_bit(iommu->domain_ids,
-				cap_ndoms(iommu->cap), i+1);
 		}
 	}
 
@@ -1292,14 +1284,11 @@ static void iommu_detach_domain(struct dmar_domain *domain,
 
 	spin_lock_irqsave(&iommu->lock, flags);
 	ndomains = cap_ndoms(iommu->cap);
-	num = find_first_bit(iommu->domain_ids, ndomains);
-	for (; num < ndomains; ) {
+	for_each_bit(num, iommu->domain_ids, ndomains) {
 		if (iommu->domains[num] == domain) {
 			found = 1;
 			break;
 		}
-		num = find_next_bit(iommu->domain_ids,
-				    cap_ndoms(iommu->cap), num+1);
 	}
 
 	if (found) {
@@ -1485,15 +1474,12 @@ static int domain_context_mapping_one(struct dmar_domain *domain, int segment,
 
 		/* find an available domain id for this device in iommu */
 		ndomains = cap_ndoms(iommu->cap);
-		num = find_first_bit(iommu->domain_ids, ndomains);
-		for (; num < ndomains; ) {
+		for_each_bit(num, iommu->domain_ids, ndomains) {
 			if (iommu->domains[num] == domain) {
 				id = num;
 				found = 1;
 				break;
 			}
-			num = find_next_bit(iommu->domain_ids,
-					    cap_ndoms(iommu->cap), num+1);
 		}
 
 		if (found == 0) {
@@ -3441,12 +3427,9 @@ static int vm_domain_min_agaw(struct dmar_domain *domain)
 	int i;
 	int min_agaw = domain->agaw;
 
-	i = find_first_bit(&domain->iommu_bmp, g_num_of_iommus);
-	for (; i < g_num_of_iommus; ) {
+	for_each_bit(i, &domain->iommu_bmp, g_num_of_iommus) {
 		if (min_agaw > g_iommus[i]->agaw)
 			min_agaw = g_iommus[i]->agaw;
-
-		i = find_next_bit(&domain->iommu_bmp, g_num_of_iommus, i+1);
 	}
 
 	return min_agaw;
@@ -3512,8 +3495,7 @@ static void iommu_free_vm_domain(struct dmar_domain *domain)
 		iommu = drhd->iommu;
 
 		ndomains = cap_ndoms(iommu->cap);
-		i = find_first_bit(iommu->domain_ids, ndomains);
-		for (; i < ndomains; ) {
+		for_each_bit(i, iommu->domain_ids, ndomains) {
 			if (iommu->domains[i] == domain) {
 				spin_lock_irqsave(&iommu->lock, flags);
 				clear_bit(i, iommu->domain_ids);
@@ -3521,7 +3503,6 @@ static void iommu_free_vm_domain(struct dmar_domain *domain)
 				spin_unlock_irqrestore(&iommu->lock, flags);
 				break;
 			}
-			i = find_next_bit(iommu->domain_ids, ndomains, i+1);
 		}
 	}
 }
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/7] infiniband: Use for_each_bit
  2010-01-31 11:53 [PATCH 1/7] sched: Use for_each_bit Akinobu Mita
                   ` (2 preceding siblings ...)
  2010-01-31 11:53 ` [PATCH 4/7] intel-iommu: " Akinobu Mita
@ 2010-01-31 11:53 ` Akinobu Mita
  2010-01-31 11:53 ` [PATCH 6/7] atm: " Akinobu Mita
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Akinobu Mita @ 2010-01-31 11:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: Akinobu Mita, Roland Dreier, Sean Hefty, Hal Rosenstock,
	linux-rdma

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: linux-rdma@vger.kernel.org
---
 drivers/infiniband/core/mad.c |   21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 7522008..a0b00ba 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -1193,10 +1193,7 @@ static int method_in_use(struct ib_mad_mgmt_method_table **method,
 {
 	int i;
 
-	for (i = find_first_bit(mad_reg_req->method_mask, IB_MGMT_MAX_METHODS);
-	     i < IB_MGMT_MAX_METHODS;
-	     i = find_next_bit(mad_reg_req->method_mask, IB_MGMT_MAX_METHODS,
-			       1+i)) {
+	for_each_bit(i, mad_reg_req->method_mask, IB_MGMT_MAX_METHODS) {
 		if ((*method)->agent[i]) {
 			printk(KERN_ERR PFX "Method %d already in use\n", i);
 			return -EINVAL;
@@ -1330,13 +1327,9 @@ static int add_nonoui_reg_req(struct ib_mad_reg_req *mad_reg_req,
 		goto error3;
 
 	/* Finally, add in methods being registered */
-	for (i = find_first_bit(mad_reg_req->method_mask,
-				IB_MGMT_MAX_METHODS);
-	     i < IB_MGMT_MAX_METHODS;
-	     i = find_next_bit(mad_reg_req->method_mask, IB_MGMT_MAX_METHODS,
-			       1+i)) {
+	for_each_bit(i, mad_reg_req->method_mask, IB_MGMT_MAX_METHODS)
 		(*method)->agent[i] = agent_priv;
-	}
+
 	return 0;
 
 error3:
@@ -1429,13 +1422,9 @@ check_in_use:
 		goto error4;
 
 	/* Finally, add in methods being registered */
-	for (i = find_first_bit(mad_reg_req->method_mask,
-				IB_MGMT_MAX_METHODS);
-	     i < IB_MGMT_MAX_METHODS;
-	     i = find_next_bit(mad_reg_req->method_mask, IB_MGMT_MAX_METHODS,
-			       1+i)) {
+	for_each_bit(i, mad_reg_req->method_mask, IB_MGMT_MAX_METHODS)
 		(*method)->agent[i] = agent_priv;
-	}
+
 	return 0;
 
 error4:
-- 
1.6.0.6

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/7] atm: Use for_each_bit
  2010-01-31 11:53 [PATCH 1/7] sched: Use for_each_bit Akinobu Mita
                   ` (3 preceding siblings ...)
  2010-01-31 11:53 ` [PATCH 5/7] infiniband: " Akinobu Mita
@ 2010-01-31 11:53 ` Akinobu Mita
  2010-01-31 11:53 ` [PATCH 7/7] hpet: " Akinobu Mita
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Akinobu Mita @ 2010-01-31 11:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Akinobu Mita, Chas Williams, linux-atm-general, netdev

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Chas Williams <chas@cmf.nrl.navy.mil>
Cc: linux-atm-general@lists.sourceforge.net
Cc: netdev@vger.kernel.org
---
 drivers/atm/lanai.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index cf97c34..97700f8 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -306,11 +306,10 @@ static void vci_bitfield_iterate(struct lanai_dev *lanai,
 	const unsigned long *lp,
 	void (*func)(struct lanai_dev *,vci_t vci))
 {
-	vci_t vci = find_first_bit(lp, NUM_VCI);
-	while (vci < NUM_VCI) {
+	vci_t vci;
+
+	for_each_bit(vci, lp, NUM_VCI)
 		func(lanai, vci);
-		vci = find_next_bit(lp, NUM_VCI, vci + 1);
-	}
 }
 
 /* -------------------- BUFFER  UTILITIES: */
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/7] hpet: Use for_each_bit
  2010-01-31 11:53 [PATCH 1/7] sched: Use for_each_bit Akinobu Mita
                   ` (4 preceding siblings ...)
  2010-01-31 11:53 ` [PATCH 6/7] atm: " Akinobu Mita
@ 2010-01-31 11:53 ` Akinobu Mita
  2010-01-31 12:06 ` [PATCH 1/7] sched: " Alexey Dobriyan
  2010-02-02  8:24 ` [tip:sched/core] " tip-bot for Akinobu Mita
  7 siblings, 0 replies; 12+ messages in thread
From: Akinobu Mita @ 2010-01-31 11:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Akinobu Mita

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 drivers/char/hpet.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index e481c59..b509185 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -215,9 +215,7 @@ static void hpet_timer_set_irq(struct hpet_dev *devp)
 	else
 		v &= ~0xffff;
 
-	for (irq = find_first_bit(&v, HPET_MAX_IRQ); irq < HPET_MAX_IRQ;
-		irq = find_next_bit(&v, HPET_MAX_IRQ, 1 + irq)) {
-
+	for_each_bit(irq, &v, HPET_MAX_IRQ) {
 		if (irq >= nr_irqs) {
 			irq = HPET_MAX_IRQ;
 			break;
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/7] sched: Use for_each_bit
  2010-01-31 11:53 [PATCH 1/7] sched: Use for_each_bit Akinobu Mita
                   ` (5 preceding siblings ...)
  2010-01-31 11:53 ` [PATCH 7/7] hpet: " Akinobu Mita
@ 2010-01-31 12:06 ` Alexey Dobriyan
  2010-02-01  2:38   ` Andrew Morton
  2010-02-02  8:24 ` [tip:sched/core] " tip-bot for Akinobu Mita
  7 siblings, 1 reply; 12+ messages in thread
From: Alexey Dobriyan @ 2010-01-31 12:06 UTC (permalink / raw)
  To: Akinobu Mita; +Cc: linux-kernel, Ingo Molnar, Peter Zijlstra

On Sun, Jan 31, 2010 at 1:53 PM, Akinobu Mita <akinobu.mita@gmail.com> wrote:
>  #define for_each_cpupri_active(array, idx)                    \
> -  for (idx = find_first_bit(array, CPUPRI_NR_PRIORITIES);     \
> -       idx < CPUPRI_NR_PRIORITIES;                            \
> -       idx = find_next_bit(array, CPUPRI_NR_PRIORITIES, idx+1))
> +       for_each_bit(idx, array, CPUPRI_NR_PRIORITIES)

It should be called for_each_set_bit().

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/7] sched: Use for_each_bit
  2010-01-31 12:06 ` [PATCH 1/7] sched: " Alexey Dobriyan
@ 2010-02-01  2:38   ` Andrew Morton
  2010-02-01  2:54     ` Akinobu Mita
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Morton @ 2010-02-01  2:38 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Akinobu Mita, linux-kernel, Ingo Molnar, Peter Zijlstra

On Sun, 31 Jan 2010 14:06:10 +0200 Alexey Dobriyan <adobriyan@gmail.com> wrote:

> On Sun, Jan 31, 2010 at 1:53 PM, Akinobu Mita <akinobu.mita@gmail.com> wrote:
> > __#define for_each_cpupri_active(array, idx) __ __ __ __ __ __ __ __ __ __\
> > - __for (idx = find_first_bit(array, CPUPRI_NR_PRIORITIES); __ __ \
> > - __ __ __ idx < CPUPRI_NR_PRIORITIES; __ __ __ __ __ __ __ __ __ __ __ __ __ __\
> > - __ __ __ idx = find_next_bit(array, CPUPRI_NR_PRIORITIES, idx+1))
> > + __ __ __ for_each_bit(idx, array, CPUPRI_NR_PRIORITIES)
> 
> It should be called for_each_set_bit().

Agree.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/7] sched: Use for_each_bit
  2010-02-01  2:38   ` Andrew Morton
@ 2010-02-01  2:54     ` Akinobu Mita
  2010-02-01  3:00       ` Andrew Morton
  0 siblings, 1 reply; 12+ messages in thread
From: Akinobu Mita @ 2010-02-01  2:54 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Alexey Dobriyan, linux-kernel, Ingo Molnar, Peter Zijlstra

2010/2/1 Andrew Morton <akpm@linux-foundation.org>:
> On Sun, 31 Jan 2010 14:06:10 +0200 Alexey Dobriyan <adobriyan@gmail.com> wrote:
>
>> On Sun, Jan 31, 2010 at 1:53 PM, Akinobu Mita <akinobu.mita@gmail.com> wrote:
>> > __#define for_each_cpupri_active(array, idx) __ __ __ __ __ __ __ __ __ __\
>> > - __for (idx = find_first_bit(array, CPUPRI_NR_PRIORITIES); __ __ \
>> > - __ __ __ idx < CPUPRI_NR_PRIORITIES; __ __ __ __ __ __ __ __ __ __ __ __ __ __\
>> > - __ __ __ idx = find_next_bit(array, CPUPRI_NR_PRIORITIES, idx+1))
>> > + __ __ __ for_each_bit(idx, array, CPUPRI_NR_PRIORITIES)
>>
>> It should be called for_each_set_bit().
>
> Agree.

(I'm resending because I failed to reply all)

You mean for_each_bit() should be renamed to for_each_set_bit() ?

I'm not sure. But if so, find_first_bit() also should be renamed to
find_first_set_bit() and so on?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/7] sched: Use for_each_bit
  2010-02-01  2:54     ` Akinobu Mita
@ 2010-02-01  3:00       ` Andrew Morton
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2010-02-01  3:00 UTC (permalink / raw)
  To: Akinobu Mita; +Cc: Alexey Dobriyan, linux-kernel, Ingo Molnar, Peter Zijlstra

On Mon, 1 Feb 2010 11:54:14 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote:

> 2010/2/1 Andrew Morton <akpm@linux-foundation.org>:
> > On Sun, 31 Jan 2010 14:06:10 +0200 Alexey Dobriyan <adobriyan@gmail.com> wrote:
> >
> >> On Sun, Jan 31, 2010 at 1:53 PM, Akinobu Mita <akinobu.mita@gmail.com> wrote:
> >> > __#define for_each_cpupri_active(array, idx) __ __ __ __ __ __ __ __ __ __\
> >> > - __for (idx = find_first_bit(array, CPUPRI_NR_PRIORITIES); __ __ \
> >> > - __ __ __ idx < CPUPRI_NR_PRIORITIES; __ __ __ __ __ __ __ __ __ __ __ __ __ __\
> >> > - __ __ __ idx = find_next_bit(array, CPUPRI_NR_PRIORITIES, idx+1))
> >> > + __ __ __ for_each_bit(idx, array, CPUPRI_NR_PRIORITIES)
> >>
> >> It should be called for_each_set_bit().
> >
> > Agree.
> 
> (I'm resending because I failed to reply all)
> 
> You mean for_each_bit() should be renamed to for_each_set_bit() ?

Yes.

> I'm not sure. But if so, find_first_bit() also should be renamed to
> find_first_set_bit() and so on?

Yes, it should have been.  It's a bit late to correct that mistake, but
it's not too late to fix for_each_bit().

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tip:sched/core] sched: Use for_each_bit
  2010-01-31 11:53 [PATCH 1/7] sched: Use for_each_bit Akinobu Mita
                   ` (6 preceding siblings ...)
  2010-01-31 12:06 ` [PATCH 1/7] sched: " Alexey Dobriyan
@ 2010-02-02  8:24 ` tip-bot for Akinobu Mita
  7 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Akinobu Mita @ 2010-02-02  8:24 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, akpm, peterz, akinobu.mita, tglx, mingo

Commit-ID:  90fdbdb48442a03c72cae5463e6edb64cb3a3a7d
Gitweb:     http://git.kernel.org/tip/90fdbdb48442a03c72cae5463e6edb64cb3a3a7d
Author:     Akinobu Mita <akinobu.mita@gmail.com>
AuthorDate: Sun, 31 Jan 2010 20:53:24 +0900
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 2 Feb 2010 06:58:27 +0100

sched: Use for_each_bit

No change in functionality.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <1264938810-4173-1-git-send-email-akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/sched_cpupri.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/kernel/sched_cpupri.c b/kernel/sched_cpupri.c
index 597b330..eeb3506 100644
--- a/kernel/sched_cpupri.c
+++ b/kernel/sched_cpupri.c
@@ -47,9 +47,7 @@ static int convert_prio(int prio)
 }
 
 #define for_each_cpupri_active(array, idx)                    \
-  for (idx = find_first_bit(array, CPUPRI_NR_PRIORITIES);     \
-       idx < CPUPRI_NR_PRIORITIES;                            \
-       idx = find_next_bit(array, CPUPRI_NR_PRIORITIES, idx+1))
+	for_each_bit(idx, array, CPUPRI_NR_PRIORITIES)
 
 /**
  * cpupri_find - find the best (lowest-pri) CPU in the system

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-02-02  8:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-31 11:53 [PATCH 1/7] sched: Use for_each_bit Akinobu Mita
2010-01-31 11:53 ` [PATCH 2/7] bitmap: " Akinobu Mita
2010-01-31 11:53 ` [PATCH 3/7] phonet: " Akinobu Mita
2010-01-31 11:53 ` [PATCH 4/7] intel-iommu: " Akinobu Mita
2010-01-31 11:53 ` [PATCH 5/7] infiniband: " Akinobu Mita
2010-01-31 11:53 ` [PATCH 6/7] atm: " Akinobu Mita
2010-01-31 11:53 ` [PATCH 7/7] hpet: " Akinobu Mita
2010-01-31 12:06 ` [PATCH 1/7] sched: " Alexey Dobriyan
2010-02-01  2:38   ` Andrew Morton
2010-02-01  2:54     ` Akinobu Mita
2010-02-01  3:00       ` Andrew Morton
2010-02-02  8:24 ` [tip:sched/core] " tip-bot for Akinobu Mita

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.