* [PATCH v3 1/7] m68knommu: fix build error due to the lack of find_next_bit_le()
2011-04-27 13:20 [PATCH v3 0/7] remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
2011-04-27 13:20 ` Akinobu Mita
2011-05-03 6:58 ` Greg Ungerer
2011-04-27 13:20 ` [PATCH v3 2/7] arch: add #define for each of optimized find bitops Akinobu Mita
` (5 subsequent siblings)
6 siblings, 2 replies; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd; +Cc: Akinobu Mita, Greg Ungerer
m68knommu can't build ext4, udf, and ocfs2 due to the lack of
find_next_bit_le().
This implements find_next_bit_le() on m68knommu by duplicating the
generic find_next_bit_le() in lib/find_next_bit.c.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
---
This patch should go into 2.6.39
arch/m68k/include/asm/bitops_no.h | 44 +++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 7d3779f..97d1d0c 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -336,6 +336,50 @@ found_middle:
return result + ffz(__swab32(tmp));
}
+static inline unsigned long find_next_bit_le(const void *addr, unsigned
+ long size, unsigned long offset)
+{
+ const unsigned long *p = addr;
+ unsigned long result = offset & ~(BITS_PER_LONG - 1);
+ unsigned long tmp;
+
+ if (offset >= size)
+ return size;
+ p += offset / BITS_PER_LONG;
+ size -= result;
+ offset &= (BITS_PER_LONG - 1UL);
+ if (offset) {
+ tmp = __swab32(*(p++));
+ tmp &= (~0UL << offset);
+ if (size < BITS_PER_LONG)
+ goto found_first;
+ if (tmp)
+ goto found_middle;
+ size -= BITS_PER_LONG;
+ result += BITS_PER_LONG;
+ }
+
+ while (size & ~(BITS_PER_LONG - 1)) {
+ tmp = *(p++);
+ if (tmp)
+ goto found_middle_swap;
+ result += BITS_PER_LONG;
+ size -= BITS_PER_LONG;
+ }
+ if (!size)
+ return result;
+ tmp = __swab32(*p);
+found_first:
+ tmp &= (~0UL >> (BITS_PER_LONG - size));
+ if (tmp == 0UL) /* Are any bits set? */
+ return result + size; /* Nope. */
+found_middle:
+ return result + __ffs(tmp);
+
+found_middle_swap:
+ return result + __ffs(__swab32(tmp));
+}
+
#endif /* __KERNEL__ */
#include <asm-generic/bitops/fls.h>
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 1/7] m68knommu: fix build error due to the lack of find_next_bit_le()
2011-04-27 13:20 ` [PATCH v3 1/7] m68knommu: fix build error due to the lack of find_next_bit_le() Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
2011-05-03 6:58 ` Greg Ungerer
1 sibling, 0 replies; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd; +Cc: Akinobu Mita, Greg Ungerer
m68knommu can't build ext4, udf, and ocfs2 due to the lack of
find_next_bit_le().
This implements find_next_bit_le() on m68knommu by duplicating the
generic find_next_bit_le() in lib/find_next_bit.c.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
---
This patch should go into 2.6.39
arch/m68k/include/asm/bitops_no.h | 44 +++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 7d3779f..97d1d0c 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -336,6 +336,50 @@ found_middle:
return result + ffz(__swab32(tmp));
}
+static inline unsigned long find_next_bit_le(const void *addr, unsigned
+ long size, unsigned long offset)
+{
+ const unsigned long *p = addr;
+ unsigned long result = offset & ~(BITS_PER_LONG - 1);
+ unsigned long tmp;
+
+ if (offset >= size)
+ return size;
+ p += offset / BITS_PER_LONG;
+ size -= result;
+ offset &= (BITS_PER_LONG - 1UL);
+ if (offset) {
+ tmp = __swab32(*(p++));
+ tmp &= (~0UL << offset);
+ if (size < BITS_PER_LONG)
+ goto found_first;
+ if (tmp)
+ goto found_middle;
+ size -= BITS_PER_LONG;
+ result += BITS_PER_LONG;
+ }
+
+ while (size & ~(BITS_PER_LONG - 1)) {
+ tmp = *(p++);
+ if (tmp)
+ goto found_middle_swap;
+ result += BITS_PER_LONG;
+ size -= BITS_PER_LONG;
+ }
+ if (!size)
+ return result;
+ tmp = __swab32(*p);
+found_first:
+ tmp &= (~0UL >> (BITS_PER_LONG - size));
+ if (tmp == 0UL) /* Are any bits set? */
+ return result + size; /* Nope. */
+found_middle:
+ return result + __ffs(tmp);
+
+found_middle_swap:
+ return result + __ffs(__swab32(tmp));
+}
+
#endif /* __KERNEL__ */
#include <asm-generic/bitops/fls.h>
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v3 1/7] m68knommu: fix build error due to the lack of find_next_bit_le()
2011-04-27 13:20 ` [PATCH v3 1/7] m68knommu: fix build error due to the lack of find_next_bit_le() Akinobu Mita
2011-04-27 13:20 ` Akinobu Mita
@ 2011-05-03 6:58 ` Greg Ungerer
2011-05-03 9:11 ` Akinobu Mita
1 sibling, 1 reply; 17+ messages in thread
From: Greg Ungerer @ 2011-05-03 6:58 UTC (permalink / raw)
To: Akinobu Mita; +Cc: linux-kernel, linux-arch, akpm, arnd, Greg Ungerer
Hi Akinobu,
On 27/04/11 23:20, Akinobu Mita wrote:
> m68knommu can't build ext4, udf, and ocfs2 due to the lack of
> find_next_bit_le().
>
> This implements find_next_bit_le() on m68knommu by duplicating the
> generic find_next_bit_le() in lib/find_next_bit.c.
Wouldn't the m68k specific implementation of this in
arch/m68k/include/asm/bitops_mm.h be better?
(bitops_*.h is still on my list of files to clean up and
merge for m68k mmu and non-mmu)
Regards
Greg
> Signed-off-by: Akinobu Mita<akinobu.mita@gmail.com>
> Cc: Greg Ungerer<gerg@uclinux.org>
> ---
>
> This patch should go into 2.6.39
>
> arch/m68k/include/asm/bitops_no.h | 44 +++++++++++++++++++++++++++++++++++++
> 1 files changed, 44 insertions(+), 0 deletions(-)
>
> diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
> index 7d3779f..97d1d0c 100644
> --- a/arch/m68k/include/asm/bitops_no.h
> +++ b/arch/m68k/include/asm/bitops_no.h
> @@ -336,6 +336,50 @@ found_middle:
> return result + ffz(__swab32(tmp));
> }
>
> +static inline unsigned long find_next_bit_le(const void *addr, unsigned
> + long size, unsigned long offset)
> +{
> + const unsigned long *p = addr;
> + unsigned long result = offset& ~(BITS_PER_LONG - 1);
> + unsigned long tmp;
> +
> + if (offset>= size)
> + return size;
> + p += offset / BITS_PER_LONG;
> + size -= result;
> + offset&= (BITS_PER_LONG - 1UL);
> + if (offset) {
> + tmp = __swab32(*(p++));
> + tmp&= (~0UL<< offset);
> + if (size< BITS_PER_LONG)
> + goto found_first;
> + if (tmp)
> + goto found_middle;
> + size -= BITS_PER_LONG;
> + result += BITS_PER_LONG;
> + }
> +
> + while (size& ~(BITS_PER_LONG - 1)) {
> + tmp = *(p++);
> + if (tmp)
> + goto found_middle_swap;
> + result += BITS_PER_LONG;
> + size -= BITS_PER_LONG;
> + }
> + if (!size)
> + return result;
> + tmp = __swab32(*p);
> +found_first:
> + tmp&= (~0UL>> (BITS_PER_LONG - size));
> + if (tmp == 0UL) /* Are any bits set? */
> + return result + size; /* Nope. */
> +found_middle:
> + return result + __ffs(tmp);
> +
> +found_middle_swap:
> + return result + __ffs(__swab32(tmp));
> +}
> +
> #endif /* __KERNEL__ */
>
> #include<asm-generic/bitops/fls.h>
--
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: gerg@snapgear.com
SnapGear Group, McAfee PHONE: +61 7 3435 2888
8 Gardner Close FAX: +61 7 3217 5323
Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 1/7] m68knommu: fix build error due to the lack of find_next_bit_le()
2011-05-03 6:58 ` Greg Ungerer
@ 2011-05-03 9:11 ` Akinobu Mita
2011-05-03 9:12 ` Geert Uytterhoeven
0 siblings, 1 reply; 17+ messages in thread
From: Akinobu Mita @ 2011-05-03 9:11 UTC (permalink / raw)
To: Greg Ungerer; +Cc: linux-kernel, linux-arch, akpm, arnd, Greg Ungerer, geert
2011/5/3, Greg Ungerer <gerg@snapgear.com>:
> Hi Akinobu,
>
> On 27/04/11 23:20, Akinobu Mita wrote:
>> m68knommu can't build ext4, udf, and ocfs2 due to the lack of
>> find_next_bit_le().
>>
>> This implements find_next_bit_le() on m68knommu by duplicating the
>> generic find_next_bit_le() in lib/find_next_bit.c.
>
> Wouldn't the m68k specific implementation of this in
> arch/m68k/include/asm/bitops_mm.h be better?
find_next_bit_le() in bitops_mm.h has a bug
(Please see https://lkml.org/lkml/2011/4/3/43) and it is not fixed
in mainline yet. So I decided to use generic one for the safety.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 1/7] m68knommu: fix build error due to the lack of find_next_bit_le()
2011-05-03 9:11 ` Akinobu Mita
@ 2011-05-03 9:12 ` Geert Uytterhoeven
0 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2011-05-03 9:12 UTC (permalink / raw)
To: Akinobu Mita
Cc: Greg Ungerer, linux-kernel, linux-arch, akpm, arnd, Greg Ungerer
On Tue, May 3, 2011 at 11:11, Akinobu Mita <akinobu.mita@gmail.com> wrote:
> 2011/5/3, Greg Ungerer <gerg@snapgear.com>:
>> Hi Akinobu,
>>
>> On 27/04/11 23:20, Akinobu Mita wrote:
>>> m68knommu can't build ext4, udf, and ocfs2 due to the lack of
>>> find_next_bit_le().
>>>
>>> This implements find_next_bit_le() on m68knommu by duplicating the
>>> generic find_next_bit_le() in lib/find_next_bit.c.
>>
>> Wouldn't the m68k specific implementation of this in
>> arch/m68k/include/asm/bitops_mm.h be better?
>
> find_next_bit_le() in bitops_mm.h has a bug
> (Please see https://lkml.org/lkml/2011/4/3/43) and it is not fixed
> in mainline yet. So I decided to use generic one for the safety.
Yeah, I still have to create a for-2.6.40 branch and add it there.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 2/7] arch: add #define for each of optimized find bitops
2011-04-27 13:20 [PATCH v3 0/7] remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
2011-04-27 13:20 ` [PATCH v3 1/7] m68knommu: fix build error due to the lack of find_next_bit_le() Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
2011-04-27 13:20 ` Akinobu Mita
2011-04-27 14:00 ` Geert Uytterhoeven
2011-04-27 13:20 ` [PATCH v3 3/7] bitops: add #ifndef for each of " Akinobu Mita
` (4 subsequent siblings)
6 siblings, 2 replies; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd
Cc: Akinobu Mita, Martin Schwidefsky, Heiko Carstens,
Geert Uytterhoeven
The style that we normally use in asm-generic is to test the macro itself
for existence, so in asm-generic, do:
#ifndef find_next_zero_bit_le
extern unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset);
#endif
and in the architectures, write
static inline unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset)
#define find_next_zero_bit_le find_next_zero_bit_le
This adds the #define for each of the optimized find bitops in the
architectures.
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
---
Changes from previous submission:
- Add Acked-by: lines
- Add #define for find_next_bit_le on m68knommu
arch/arm/include/asm/bitops.h | 3 +++
arch/avr32/include/asm/bitops.h | 15 +++++++++++++++
arch/m68k/include/asm/bitops_mm.h | 8 ++++++++
arch/m68k/include/asm/bitops_no.h | 2 ++
arch/s390/include/asm/bitops.h | 8 ++++++++
5 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 6b7403f..18a024b 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -326,16 +326,19 @@ static inline int find_first_zero_bit_le(const void *p, unsigned size)
{
return _find_first_zero_bit_le(p, size);
}
+#define find_first_zero_bit_le find_first_zero_bit_le
static inline int find_next_zero_bit_le(const void *p, int size, int offset)
{
return _find_next_zero_bit_le(p, size, offset);
}
+#define find_next_zero_bit_le find_next_zero_bit_le
static inline int find_next_bit_le(const void *p, int size, int offset)
{
return _find_next_bit_le(p, size, offset);
}
+#define find_next_bit_le find_next_bit_le
/*
* Ext2 is defined to use little-endian byte ordering.
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 72444d9..b70c19b 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -270,14 +270,21 @@ static inline int __fls(unsigned long word)
unsigned long find_first_zero_bit(const unsigned long *addr,
unsigned long size);
+#define find_first_zero_bit find_first_zero_bit
+
unsigned long find_next_zero_bit(const unsigned long *addr,
unsigned long size,
unsigned long offset);
+#define find_next_zero_bit find_next_zero_bit
+
unsigned long find_first_bit(const unsigned long *addr,
unsigned long size);
+#define find_first_bit find_first_bit
+
unsigned long find_next_bit(const unsigned long *addr,
unsigned long size,
unsigned long offset);
+#define find_next_bit find_next_bit
/*
* ffs: find first bit set. This is defined the same way as
@@ -299,6 +306,14 @@ static inline int ffs(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
+extern unsigned long find_next_zero_bit_le(const void *addr,
+ unsigned long size, unsigned long offset);
+#define find_next_zero_bit_le find_next_zero_bit_le
+
+extern unsigned long find_next_bit_le(const void *addr,
+ unsigned long size, unsigned long offset);
+#define find_next_bit_le find_next_bit_le
+
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index 9d69f6e..a938ebe 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -198,6 +198,7 @@ static inline int find_first_zero_bit(const unsigned long *vaddr,
out:
return ((long)p - (long)vaddr - 4) * 8 + res;
}
+#define find_first_zero_bit find_first_zero_bit
static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
int offset)
@@ -223,6 +224,7 @@ static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
res = find_first_zero_bit(p, size - ((long)p - (long)vaddr) * 8);
return offset + res;
}
+#define find_next_zero_bit find_next_zero_bit
static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
{
@@ -245,6 +247,7 @@ static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
out:
return ((long)p - (long)vaddr - 4) * 8 + res;
}
+#define find_first_bit find_first_bit
static inline int find_next_bit(const unsigned long *vaddr, int size,
int offset)
@@ -270,6 +273,7 @@ static inline int find_next_bit(const unsigned long *vaddr, int size,
res = find_first_bit(p, size - ((long)p - (long)vaddr) * 8);
return offset + res;
}
+#define find_next_bit find_next_bit
/*
* ffz = Find First Zero in word. Undefined if no zero exists,
@@ -384,6 +388,7 @@ static inline int find_first_zero_bit_le(const void *vaddr, unsigned size)
break;
return (p - addr) * 32 + res;
}
+#define find_first_zero_bit_le find_first_zero_bit_le
static inline unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset)
@@ -408,6 +413,7 @@ static inline unsigned long find_next_zero_bit_le(const void *addr,
/* No zero yet, search remaining full bytes for a zero */
return offset + find_first_zero_bit_le(p, size - offset);
}
+#define find_next_zero_bit_le find_next_zero_bit_le
static inline int find_first_bit_le(const void *vaddr, unsigned size)
{
@@ -429,6 +435,7 @@ static inline int find_first_bit_le(const void *vaddr, unsigned size)
break;
return (p - addr) * 32 + res;
}
+#define find_first_bit_le find_first_bit_le
static inline unsigned long find_next_bit_le(const void *addr,
unsigned long size, unsigned long offset)
@@ -453,6 +460,7 @@ static inline unsigned long find_next_bit_le(const void *addr,
/* No set bit yet, search remaining full bytes for a set bit */
return offset + find_first_bit_le(p, size - offset);
}
+#define find_next_bit_le find_next_bit_le
/* Bitmap functions for the ext2 filesystem. */
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 97d1d0c..cd229fb 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -335,6 +335,7 @@ found_first:
found_middle:
return result + ffz(__swab32(tmp));
}
+#define find_next_zero_bit_le find_next_zero_bit_le
static inline unsigned long find_next_bit_le(const void *addr, unsigned
long size, unsigned long offset)
@@ -379,6 +380,7 @@ found_middle:
found_middle_swap:
return result + __ffs(__swab32(tmp));
}
+#define find_next_bit_le find_next_bit_le
#endif /* __KERNEL__ */
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index e1c8f3a..426c974 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -621,6 +621,7 @@ static inline unsigned long find_first_zero_bit(const unsigned long *addr,
bits = __ffz_word(bytes*8, __load_ulong_be(addr, bytes));
return (bits < size) ? bits : size;
}
+#define find_first_zero_bit find_first_zero_bit
/**
* find_first_bit - find the first set bit in a memory region
@@ -641,6 +642,7 @@ static inline unsigned long find_first_bit(const unsigned long * addr,
bits = __ffs_word(bytes*8, __load_ulong_be(addr, bytes));
return (bits < size) ? bits : size;
}
+#define find_first_bit find_first_bit
/**
* find_next_zero_bit - find the first zero bit in a memory region
@@ -677,6 +679,7 @@ static inline int find_next_zero_bit (const unsigned long * addr,
}
return offset + find_first_zero_bit(p, size);
}
+#define find_next_zero_bit find_next_zero_bit
/**
* find_next_bit - find the first set bit in a memory region
@@ -713,6 +716,7 @@ static inline int find_next_bit (const unsigned long * addr,
}
return offset + find_first_bit(p, size);
}
+#define find_next_bit find_next_bit
/*
* Every architecture must define this function. It's the fastest
@@ -787,6 +791,7 @@ static inline int find_first_zero_bit_le(void *vaddr, unsigned int size)
bits = __ffz_word(bytes*8, __load_ulong_le(vaddr, bytes));
return (bits < size) ? bits : size;
}
+#define find_first_zero_bit_le find_first_zero_bit_le
static inline int find_next_zero_bit_le(void *vaddr, unsigned long size,
unsigned long offset)
@@ -816,6 +821,7 @@ static inline int find_next_zero_bit_le(void *vaddr, unsigned long size,
}
return offset + find_first_zero_bit_le(p, size);
}
+#define find_next_zero_bit_le find_next_zero_bit_le
static inline unsigned long find_first_bit_le(void *vaddr, unsigned long size)
{
@@ -827,6 +833,7 @@ static inline unsigned long find_first_bit_le(void *vaddr, unsigned long size)
bits = __ffs_word(bytes*8, __load_ulong_le(vaddr, bytes));
return (bits < size) ? bits : size;
}
+#define find_first_bit_le find_first_bit_le
static inline int find_next_bit_le(void *vaddr, unsigned long size,
unsigned long offset)
@@ -856,6 +863,7 @@ static inline int find_next_bit_le(void *vaddr, unsigned long size,
}
return offset + find_first_bit_le(p, size);
}
+#define find_next_bit_le find_next_bit_le
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_bit_le(nr, addr)
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 2/7] arch: add #define for each of optimized find bitops
2011-04-27 13:20 ` [PATCH v3 2/7] arch: add #define for each of optimized find bitops Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
2011-04-27 14:00 ` Geert Uytterhoeven
1 sibling, 0 replies; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd
Cc: Akinobu Mita, Martin Schwidefsky, Heiko Carstens,
Geert Uytterhoeven
The style that we normally use in asm-generic is to test the macro itself
for existence, so in asm-generic, do:
#ifndef find_next_zero_bit_le
extern unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset);
#endif
and in the architectures, write
static inline unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset)
#define find_next_zero_bit_le find_next_zero_bit_le
This adds the #define for each of the optimized find bitops in the
architectures.
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
---
Changes from previous submission:
- Add Acked-by: lines
- Add #define for find_next_bit_le on m68knommu
arch/arm/include/asm/bitops.h | 3 +++
arch/avr32/include/asm/bitops.h | 15 +++++++++++++++
arch/m68k/include/asm/bitops_mm.h | 8 ++++++++
arch/m68k/include/asm/bitops_no.h | 2 ++
arch/s390/include/asm/bitops.h | 8 ++++++++
5 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 6b7403f..18a024b 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -326,16 +326,19 @@ static inline int find_first_zero_bit_le(const void *p, unsigned size)
{
return _find_first_zero_bit_le(p, size);
}
+#define find_first_zero_bit_le find_first_zero_bit_le
static inline int find_next_zero_bit_le(const void *p, int size, int offset)
{
return _find_next_zero_bit_le(p, size, offset);
}
+#define find_next_zero_bit_le find_next_zero_bit_le
static inline int find_next_bit_le(const void *p, int size, int offset)
{
return _find_next_bit_le(p, size, offset);
}
+#define find_next_bit_le find_next_bit_le
/*
* Ext2 is defined to use little-endian byte ordering.
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 72444d9..b70c19b 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -270,14 +270,21 @@ static inline int __fls(unsigned long word)
unsigned long find_first_zero_bit(const unsigned long *addr,
unsigned long size);
+#define find_first_zero_bit find_first_zero_bit
+
unsigned long find_next_zero_bit(const unsigned long *addr,
unsigned long size,
unsigned long offset);
+#define find_next_zero_bit find_next_zero_bit
+
unsigned long find_first_bit(const unsigned long *addr,
unsigned long size);
+#define find_first_bit find_first_bit
+
unsigned long find_next_bit(const unsigned long *addr,
unsigned long size,
unsigned long offset);
+#define find_next_bit find_next_bit
/*
* ffs: find first bit set. This is defined the same way as
@@ -299,6 +306,14 @@ static inline int ffs(unsigned long word)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
+extern unsigned long find_next_zero_bit_le(const void *addr,
+ unsigned long size, unsigned long offset);
+#define find_next_zero_bit_le find_next_zero_bit_le
+
+extern unsigned long find_next_bit_le(const void *addr,
+ unsigned long size, unsigned long offset);
+#define find_next_bit_le find_next_bit_le
+
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index 9d69f6e..a938ebe 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -198,6 +198,7 @@ static inline int find_first_zero_bit(const unsigned long *vaddr,
out:
return ((long)p - (long)vaddr - 4) * 8 + res;
}
+#define find_first_zero_bit find_first_zero_bit
static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
int offset)
@@ -223,6 +224,7 @@ static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
res = find_first_zero_bit(p, size - ((long)p - (long)vaddr) * 8);
return offset + res;
}
+#define find_next_zero_bit find_next_zero_bit
static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
{
@@ -245,6 +247,7 @@ static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
out:
return ((long)p - (long)vaddr - 4) * 8 + res;
}
+#define find_first_bit find_first_bit
static inline int find_next_bit(const unsigned long *vaddr, int size,
int offset)
@@ -270,6 +273,7 @@ static inline int find_next_bit(const unsigned long *vaddr, int size,
res = find_first_bit(p, size - ((long)p - (long)vaddr) * 8);
return offset + res;
}
+#define find_next_bit find_next_bit
/*
* ffz = Find First Zero in word. Undefined if no zero exists,
@@ -384,6 +388,7 @@ static inline int find_first_zero_bit_le(const void *vaddr, unsigned size)
break;
return (p - addr) * 32 + res;
}
+#define find_first_zero_bit_le find_first_zero_bit_le
static inline unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset)
@@ -408,6 +413,7 @@ static inline unsigned long find_next_zero_bit_le(const void *addr,
/* No zero yet, search remaining full bytes for a zero */
return offset + find_first_zero_bit_le(p, size - offset);
}
+#define find_next_zero_bit_le find_next_zero_bit_le
static inline int find_first_bit_le(const void *vaddr, unsigned size)
{
@@ -429,6 +435,7 @@ static inline int find_first_bit_le(const void *vaddr, unsigned size)
break;
return (p - addr) * 32 + res;
}
+#define find_first_bit_le find_first_bit_le
static inline unsigned long find_next_bit_le(const void *addr,
unsigned long size, unsigned long offset)
@@ -453,6 +460,7 @@ static inline unsigned long find_next_bit_le(const void *addr,
/* No set bit yet, search remaining full bytes for a set bit */
return offset + find_first_bit_le(p, size - offset);
}
+#define find_next_bit_le find_next_bit_le
/* Bitmap functions for the ext2 filesystem. */
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index 97d1d0c..cd229fb 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -335,6 +335,7 @@ found_first:
found_middle:
return result + ffz(__swab32(tmp));
}
+#define find_next_zero_bit_le find_next_zero_bit_le
static inline unsigned long find_next_bit_le(const void *addr, unsigned
long size, unsigned long offset)
@@ -379,6 +380,7 @@ found_middle:
found_middle_swap:
return result + __ffs(__swab32(tmp));
}
+#define find_next_bit_le find_next_bit_le
#endif /* __KERNEL__ */
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index e1c8f3a..426c974 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -621,6 +621,7 @@ static inline unsigned long find_first_zero_bit(const unsigned long *addr,
bits = __ffz_word(bytes*8, __load_ulong_be(addr, bytes));
return (bits < size) ? bits : size;
}
+#define find_first_zero_bit find_first_zero_bit
/**
* find_first_bit - find the first set bit in a memory region
@@ -641,6 +642,7 @@ static inline unsigned long find_first_bit(const unsigned long * addr,
bits = __ffs_word(bytes*8, __load_ulong_be(addr, bytes));
return (bits < size) ? bits : size;
}
+#define find_first_bit find_first_bit
/**
* find_next_zero_bit - find the first zero bit in a memory region
@@ -677,6 +679,7 @@ static inline int find_next_zero_bit (const unsigned long * addr,
}
return offset + find_first_zero_bit(p, size);
}
+#define find_next_zero_bit find_next_zero_bit
/**
* find_next_bit - find the first set bit in a memory region
@@ -713,6 +716,7 @@ static inline int find_next_bit (const unsigned long * addr,
}
return offset + find_first_bit(p, size);
}
+#define find_next_bit find_next_bit
/*
* Every architecture must define this function. It's the fastest
@@ -787,6 +791,7 @@ static inline int find_first_zero_bit_le(void *vaddr, unsigned int size)
bits = __ffz_word(bytes*8, __load_ulong_le(vaddr, bytes));
return (bits < size) ? bits : size;
}
+#define find_first_zero_bit_le find_first_zero_bit_le
static inline int find_next_zero_bit_le(void *vaddr, unsigned long size,
unsigned long offset)
@@ -816,6 +821,7 @@ static inline int find_next_zero_bit_le(void *vaddr, unsigned long size,
}
return offset + find_first_zero_bit_le(p, size);
}
+#define find_next_zero_bit_le find_next_zero_bit_le
static inline unsigned long find_first_bit_le(void *vaddr, unsigned long size)
{
@@ -827,6 +833,7 @@ static inline unsigned long find_first_bit_le(void *vaddr, unsigned long size)
bits = __ffs_word(bytes*8, __load_ulong_le(vaddr, bytes));
return (bits < size) ? bits : size;
}
+#define find_first_bit_le find_first_bit_le
static inline int find_next_bit_le(void *vaddr, unsigned long size,
unsigned long offset)
@@ -856,6 +863,7 @@ static inline int find_next_bit_le(void *vaddr, unsigned long size,
}
return offset + find_first_bit_le(p, size);
}
+#define find_next_bit_le find_next_bit_le
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_bit_le(nr, addr)
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v3 2/7] arch: add #define for each of optimized find bitops
2011-04-27 13:20 ` [PATCH v3 2/7] arch: add #define for each of optimized find bitops Akinobu Mita
2011-04-27 13:20 ` Akinobu Mita
@ 2011-04-27 14:00 ` Geert Uytterhoeven
1 sibling, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2011-04-27 14:00 UTC (permalink / raw)
To: Akinobu Mita
Cc: linux-kernel, linux-arch, akpm, arnd, Martin Schwidefsky,
Heiko Carstens
On Wed, Apr 27, 2011 at 15:20, Akinobu Mita <akinobu.mita@gmail.com> wrote:
> The style that we normally use in asm-generic is to test the macro itself
> for existence, so in asm-generic, do:
>
> #ifndef find_next_zero_bit_le
> extern unsigned long find_next_zero_bit_le(const void *addr,
> unsigned long size, unsigned long offset);
> #endif
>
> and in the architectures, write
>
> static inline unsigned long find_next_zero_bit_le(const void *addr,
> unsigned long size, unsigned long offset)
> #define find_next_zero_bit_le find_next_zero_bit_le
>
> This adds the #define for each of the optimized find bitops in the
> architectures.
>
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
> Acked-by: Greg Ungerer <gerg@uclinux.org>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 3/7] bitops: add #ifndef for each of find bitops
2011-04-27 13:20 [PATCH v3 0/7] remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
2011-04-27 13:20 ` [PATCH v3 1/7] m68knommu: fix build error due to the lack of find_next_bit_le() Akinobu Mita
2011-04-27 13:20 ` [PATCH v3 2/7] arch: add #define for each of optimized find bitops Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
2011-04-27 13:20 ` Akinobu Mita
2011-04-27 13:20 ` [PATCH v3 4/7] arch: remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
` (3 subsequent siblings)
6 siblings, 1 reply; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd
Cc: Akinobu Mita, Martin Schwidefsky, Heiko Carstens, Greg Ungerer
The style that we normally use in asm-generic is to test the macro itself
for existence, so in asm-generic, do:
#ifndef find_next_zero_bit_le
extern unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset);
#endif
and in the architectures, write
static inline unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset)
#define find_next_zero_bit_le find_next_zero_bit_le
This adds the #ifndef for each of the find bitops in the generic header
and source files.
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Greg Ungerer <gerg@uclinux.org>
---
Changes from previous submission:
- Add Acked-by: line
- No change in the patch itself
include/asm-generic/bitops/find.h | 4 ++++
include/asm-generic/bitops/le.h | 7 +++++++
include/linux/bitops.h | 2 ++
lib/find_last_bit.c | 4 ++++
lib/find_next_bit.c | 12 ++++++++++++
5 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h
index 110fa70..71c7780 100644
--- a/include/asm-generic/bitops/find.h
+++ b/include/asm-generic/bitops/find.h
@@ -1,6 +1,7 @@
#ifndef _ASM_GENERIC_BITOPS_FIND_H_
#define _ASM_GENERIC_BITOPS_FIND_H_
+#ifndef find_next_bit
/**
* find_next_bit - find the next set bit in a memory region
* @addr: The address to base the search on
@@ -9,7 +10,9 @@
*/
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
size, unsigned long offset);
+#endif
+#ifndef find_next_zero_bit
/**
* find_next_zero_bit - find the next cleared bit in a memory region
* @addr: The address to base the search on
@@ -18,6 +21,7 @@ extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
*/
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
long size, unsigned long offset);
+#endif
#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index 946a21b..f95c663 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -30,13 +30,20 @@ static inline unsigned long find_first_zero_bit_le(const void *addr,
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
+#ifndef find_next_zero_bit_le
extern unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset);
+#endif
+
+#ifndef find_next_bit_le
extern unsigned long find_next_bit_le(const void *addr,
unsigned long size, unsigned long offset);
+#endif
+#ifndef find_first_zero_bit_le
#define find_first_zero_bit_le(addr, size) \
find_next_zero_bit_le((addr), (size), 0)
+#endif
#else
#error "Please fix <asm/byteorder.h>"
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 2184c6b..4829252 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -149,6 +149,7 @@ static inline unsigned long __ffs64(u64 word)
#ifdef __KERNEL__
#ifdef CONFIG_GENERIC_FIND_LAST_BIT
+#ifndef find_last_bit
/**
* find_last_bit - find the last set bit in a memory region
* @addr: The address to start the search at
@@ -158,6 +159,7 @@ static inline unsigned long __ffs64(u64 word)
*/
extern unsigned long find_last_bit(const unsigned long *addr,
unsigned long size);
+#endif
#endif /* CONFIG_GENERIC_FIND_LAST_BIT */
#endif /* __KERNEL__ */
diff --git a/lib/find_last_bit.c b/lib/find_last_bit.c
index 5d202e3..d903959 100644
--- a/lib/find_last_bit.c
+++ b/lib/find_last_bit.c
@@ -15,6 +15,8 @@
#include <asm/types.h>
#include <asm/byteorder.h>
+#ifndef find_last_bit
+
unsigned long find_last_bit(const unsigned long *addr, unsigned long size)
{
unsigned long words;
@@ -43,3 +45,5 @@ found:
return size;
}
EXPORT_SYMBOL(find_last_bit);
+
+#endif
diff --git a/lib/find_next_bit.c b/lib/find_next_bit.c
index b0a8767..c02d09f 100644
--- a/lib/find_next_bit.c
+++ b/lib/find_next_bit.c
@@ -17,6 +17,7 @@
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
#ifdef CONFIG_GENERIC_FIND_NEXT_BIT
+#ifndef find_next_bit
/*
* Find the next set bit in a memory region.
*/
@@ -59,7 +60,9 @@ found_middle:
return result + __ffs(tmp);
}
EXPORT_SYMBOL(find_next_bit);
+#endif
+#ifndef find_next_zero_bit
/*
* This implementation of find_{first,next}_zero_bit was stolen from
* Linus' asm-alpha/bitops.h.
@@ -103,9 +106,11 @@ found_middle:
return result + ffz(tmp);
}
EXPORT_SYMBOL(find_next_zero_bit);
+#endif
#endif /* CONFIG_GENERIC_FIND_NEXT_BIT */
#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
+#ifndef find_first_bit
/*
* Find the first set bit in a memory region.
*/
@@ -131,7 +136,9 @@ found:
return result + __ffs(tmp);
}
EXPORT_SYMBOL(find_first_bit);
+#endif
+#ifndef find_first_zero_bit
/*
* Find the first cleared bit in a memory region.
*/
@@ -157,6 +164,7 @@ found:
return result + ffz(tmp);
}
EXPORT_SYMBOL(find_first_zero_bit);
+#endif
#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
#ifdef __BIG_ENDIAN
@@ -186,6 +194,7 @@ static inline unsigned long ext2_swab(const unsigned long y)
#endif
}
+#ifndef find_next_zero_bit_le
unsigned long find_next_zero_bit_le(const void *addr, unsigned
long size, unsigned long offset)
{
@@ -229,7 +238,9 @@ found_middle_swap:
return result + ffz(ext2_swab(tmp));
}
EXPORT_SYMBOL(find_next_zero_bit_le);
+#endif
+#ifndef find_next_bit_le
unsigned long find_next_bit_le(const void *addr, unsigned
long size, unsigned long offset)
{
@@ -274,6 +285,7 @@ found_middle_swap:
return result + __ffs(ext2_swab(tmp));
}
EXPORT_SYMBOL(find_next_bit_le);
+#endif
#endif /* CONFIG_GENERIC_FIND_BIT_LE */
#endif /* __BIG_ENDIAN */
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 3/7] bitops: add #ifndef for each of find bitops
2011-04-27 13:20 ` [PATCH v3 3/7] bitops: add #ifndef for each of " Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
0 siblings, 0 replies; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd
Cc: Akinobu Mita, Martin Schwidefsky, Heiko Carstens, Greg Ungerer
The style that we normally use in asm-generic is to test the macro itself
for existence, so in asm-generic, do:
#ifndef find_next_zero_bit_le
extern unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset);
#endif
and in the architectures, write
static inline unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset)
#define find_next_zero_bit_le find_next_zero_bit_le
This adds the #ifndef for each of the find bitops in the generic header
and source files.
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Greg Ungerer <gerg@uclinux.org>
---
Changes from previous submission:
- Add Acked-by: line
- No change in the patch itself
include/asm-generic/bitops/find.h | 4 ++++
include/asm-generic/bitops/le.h | 7 +++++++
include/linux/bitops.h | 2 ++
lib/find_last_bit.c | 4 ++++
lib/find_next_bit.c | 12 ++++++++++++
5 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h
index 110fa70..71c7780 100644
--- a/include/asm-generic/bitops/find.h
+++ b/include/asm-generic/bitops/find.h
@@ -1,6 +1,7 @@
#ifndef _ASM_GENERIC_BITOPS_FIND_H_
#define _ASM_GENERIC_BITOPS_FIND_H_
+#ifndef find_next_bit
/**
* find_next_bit - find the next set bit in a memory region
* @addr: The address to base the search on
@@ -9,7 +10,9 @@
*/
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
size, unsigned long offset);
+#endif
+#ifndef find_next_zero_bit
/**
* find_next_zero_bit - find the next cleared bit in a memory region
* @addr: The address to base the search on
@@ -18,6 +21,7 @@ extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
*/
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
long size, unsigned long offset);
+#endif
#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
diff --git a/include/asm-generic/bitops/le.h b/include/asm-generic/bitops/le.h
index 946a21b..f95c663 100644
--- a/include/asm-generic/bitops/le.h
+++ b/include/asm-generic/bitops/le.h
@@ -30,13 +30,20 @@ static inline unsigned long find_first_zero_bit_le(const void *addr,
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
+#ifndef find_next_zero_bit_le
extern unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset);
+#endif
+
+#ifndef find_next_bit_le
extern unsigned long find_next_bit_le(const void *addr,
unsigned long size, unsigned long offset);
+#endif
+#ifndef find_first_zero_bit_le
#define find_first_zero_bit_le(addr, size) \
find_next_zero_bit_le((addr), (size), 0)
+#endif
#else
#error "Please fix <asm/byteorder.h>"
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 2184c6b..4829252 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -149,6 +149,7 @@ static inline unsigned long __ffs64(u64 word)
#ifdef __KERNEL__
#ifdef CONFIG_GENERIC_FIND_LAST_BIT
+#ifndef find_last_bit
/**
* find_last_bit - find the last set bit in a memory region
* @addr: The address to start the search at
@@ -158,6 +159,7 @@ static inline unsigned long __ffs64(u64 word)
*/
extern unsigned long find_last_bit(const unsigned long *addr,
unsigned long size);
+#endif
#endif /* CONFIG_GENERIC_FIND_LAST_BIT */
#endif /* __KERNEL__ */
diff --git a/lib/find_last_bit.c b/lib/find_last_bit.c
index 5d202e3..d903959 100644
--- a/lib/find_last_bit.c
+++ b/lib/find_last_bit.c
@@ -15,6 +15,8 @@
#include <asm/types.h>
#include <asm/byteorder.h>
+#ifndef find_last_bit
+
unsigned long find_last_bit(const unsigned long *addr, unsigned long size)
{
unsigned long words;
@@ -43,3 +45,5 @@ found:
return size;
}
EXPORT_SYMBOL(find_last_bit);
+
+#endif
diff --git a/lib/find_next_bit.c b/lib/find_next_bit.c
index b0a8767..c02d09f 100644
--- a/lib/find_next_bit.c
+++ b/lib/find_next_bit.c
@@ -17,6 +17,7 @@
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
#ifdef CONFIG_GENERIC_FIND_NEXT_BIT
+#ifndef find_next_bit
/*
* Find the next set bit in a memory region.
*/
@@ -59,7 +60,9 @@ found_middle:
return result + __ffs(tmp);
}
EXPORT_SYMBOL(find_next_bit);
+#endif
+#ifndef find_next_zero_bit
/*
* This implementation of find_{first,next}_zero_bit was stolen from
* Linus' asm-alpha/bitops.h.
@@ -103,9 +106,11 @@ found_middle:
return result + ffz(tmp);
}
EXPORT_SYMBOL(find_next_zero_bit);
+#endif
#endif /* CONFIG_GENERIC_FIND_NEXT_BIT */
#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
+#ifndef find_first_bit
/*
* Find the first set bit in a memory region.
*/
@@ -131,7 +136,9 @@ found:
return result + __ffs(tmp);
}
EXPORT_SYMBOL(find_first_bit);
+#endif
+#ifndef find_first_zero_bit
/*
* Find the first cleared bit in a memory region.
*/
@@ -157,6 +164,7 @@ found:
return result + ffz(tmp);
}
EXPORT_SYMBOL(find_first_zero_bit);
+#endif
#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
#ifdef __BIG_ENDIAN
@@ -186,6 +194,7 @@ static inline unsigned long ext2_swab(const unsigned long y)
#endif
}
+#ifndef find_next_zero_bit_le
unsigned long find_next_zero_bit_le(const void *addr, unsigned
long size, unsigned long offset)
{
@@ -229,7 +238,9 @@ found_middle_swap:
return result + ffz(ext2_swab(tmp));
}
EXPORT_SYMBOL(find_next_zero_bit_le);
+#endif
+#ifndef find_next_bit_le
unsigned long find_next_bit_le(const void *addr, unsigned
long size, unsigned long offset)
{
@@ -274,6 +285,7 @@ found_middle_swap:
return result + __ffs(ext2_swab(tmp));
}
EXPORT_SYMBOL(find_next_bit_le);
+#endif
#endif /* CONFIG_GENERIC_FIND_BIT_LE */
#endif /* __BIG_ENDIAN */
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 4/7] arch: remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT}
2011-04-27 13:20 [PATCH v3 0/7] remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
` (2 preceding siblings ...)
2011-04-27 13:20 ` [PATCH v3 3/7] bitops: add #ifndef for each of " Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
2011-04-27 13:20 ` Akinobu Mita
2011-04-27 13:20 ` [PATCH v3 5/7] arm: use asm-generic/bitops/le.h Akinobu Mita
` (2 subsequent siblings)
6 siblings, 1 reply; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd
Cc: Akinobu Mita, Russell King, Martin Schwidefsky, Heiko Carstens
By the previous style change, CONFIG_GENERIC_FIND_NEXT_BIT,
CONFIG_GENERIC_FIND_BIT_LE, and CONFIG_GENERIC_FIND_LAST_BIT are not used
to test for existence of find bitops anymore.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
---
Changes from previous submission:
- Add Acked-by: line
- No change in the patch itself
arch/alpha/Kconfig | 4 ----
arch/blackfin/Kconfig | 3 ---
arch/cris/Kconfig | 4 ----
arch/frv/Kconfig | 8 --------
arch/h8300/Kconfig | 8 --------
arch/ia64/Kconfig | 4 ----
arch/m32r/Kconfig | 8 --------
arch/m68k/Kconfig.nommu | 4 ----
arch/microblaze/Kconfig | 6 ------
arch/mips/Kconfig | 8 --------
arch/mn10300/Kconfig | 3 ---
arch/parisc/Kconfig | 8 --------
arch/powerpc/Kconfig | 8 --------
arch/score/Kconfig | 3 ---
arch/sh/Kconfig | 6 ------
arch/sparc/Kconfig | 8 --------
arch/tile/Kconfig | 1 -
arch/um/Kconfig.x86 | 1 -
arch/x86/Kconfig | 1 -
arch/xtensa/Kconfig | 6 ------
include/linux/bitops.h | 2 --
lib/Kconfig | 10 ----------
lib/Makefile | 9 +++------
lib/find_next_bit.c | 6 ------
24 files changed, 3 insertions(+), 126 deletions(-)
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 9808998..1e3fd03 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -40,10 +40,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
config GENERIC_CALIBRATE_DELAY
bool
default y
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 8addb12..f465e10 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -45,9 +45,6 @@ config GENERIC_BUG
config ZONE_DMA
def_bool y
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
config GENERIC_GPIO
def_bool y
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index a6d0306..b6b94a2 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -31,10 +31,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 064f621..cb884e4 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -19,14 +19,6 @@ config RWSEM_GENERIC_SPINLOCK
config RWSEM_XCHGADD_ALGORITHM
bool
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index e20322f..091ed61 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -41,14 +41,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index e5cc56a..38280ef 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -78,10 +78,6 @@ config HUGETLB_PAGE_SIZE_VARIABLE
depends on HUGETLB_PAGE
default y
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
config GENERIC_CALIBRATE_DELAY
bool
default y
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 736b808..85b44e8 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -256,14 +256,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/m68k/Kconfig.nommu b/arch/m68k/Kconfig.nommu
index 273bcca..fc98f9b 100644
--- a/arch/m68k/Kconfig.nommu
+++ b/arch/m68k/Kconfig.nommu
@@ -2,10 +2,6 @@ config FPU
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
config GENERIC_GPIO
bool
default n
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index eccdefe..e446bab 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -33,12 +33,6 @@ config ARCH_HAS_ILOG2_U32
config ARCH_HAS_ILOG2_U64
def_bool n
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
-config GENERIC_FIND_BIT_LE
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8e256cc..319c0a1 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -774,14 +774,6 @@ config ARCH_SUPPORTS_OPROFILE
bool
default y if !MIPS_MT_SMTC
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index feaf09c..1f87034 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -44,9 +44,6 @@ config GENERIC_CALIBRATE_DELAY
config GENERIC_CMOS_UPDATE
def_bool n
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 69ff049..65adc86 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -47,14 +47,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_BUG
bool
default y
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8f4d50b..17d0ddc 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -91,14 +91,6 @@ config GENERIC_HWEIGHT
bool
default y
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_GPIO
bool
help
diff --git a/arch/score/Kconfig b/arch/score/Kconfig
index e73bc78..288add8 100644
--- a/arch/score/Kconfig
+++ b/arch/score/Kconfig
@@ -43,9 +43,6 @@ config NO_DMA
config RWSEM_GENERIC_SPINLOCK
def_bool y
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 4b89da2..b20a2da 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -71,12 +71,6 @@ config GENERIC_CSUM
def_bool y
depends on SUPERH64
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
-config GENERIC_FIND_BIT_LE
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index e560d10..9d7c2ff 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -189,14 +189,6 @@ config RWSEM_XCHGADD_ALGORITHM
bool
default y if SPARC64
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y if !ULTRA_HAS_POPULATION_COUNT
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index e32b0c2..a1f4642 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -5,7 +5,6 @@ config TILE
def_bool y
select HAVE_KVM if !TILEGX
select GENERIC_FIND_FIRST_BIT
- select GENERIC_FIND_NEXT_BIT
select USE_GENERIC_SMP_HELPERS
select CC_OPTIMIZE_FOR_SIZE
select HAVE_GENERIC_HARDIRQS
diff --git a/arch/um/Kconfig.x86 b/arch/um/Kconfig.x86
index a9da516..c349960 100644
--- a/arch/um/Kconfig.x86
+++ b/arch/um/Kconfig.x86
@@ -15,7 +15,6 @@ endmenu
config UML_X86
def_bool y
select GENERIC_FIND_FIRST_BIT
- select GENERIC_FIND_NEXT_BIT
config 64BIT
bool
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index cc6c53a..2617e00 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -65,7 +65,6 @@ config X86
select HAVE_GENERIC_HARDIRQS
select HAVE_SPARSE_IRQ
select GENERIC_FIND_FIRST_BIT
- select GENERIC_FIND_NEXT_BIT
select GENERIC_IRQ_PROBE
select GENERIC_PENDING_IRQ if SMP
select GENERIC_IRQ_SHOW
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 7c275f5..5d43c1f 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -20,12 +20,6 @@ config XTENSA
config RWSEM_XCHGADD_ALGORITHM
def_bool y
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
-config GENERIC_FIND_BIT_LE
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 4829252..a3ef66a 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -148,7 +148,6 @@ static inline unsigned long __ffs64(u64 word)
#ifdef __KERNEL__
-#ifdef CONFIG_GENERIC_FIND_LAST_BIT
#ifndef find_last_bit
/**
* find_last_bit - find the last set bit in a memory region
@@ -160,7 +159,6 @@ static inline unsigned long __ffs64(u64 word)
extern unsigned long find_last_bit(const unsigned long *addr,
unsigned long size);
#endif
-#endif /* CONFIG_GENERIC_FIND_LAST_BIT */
#endif /* __KERNEL__ */
#endif
diff --git a/lib/Kconfig b/lib/Kconfig
index 9c10e38..830181c 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -19,16 +19,6 @@ config RATIONAL
config GENERIC_FIND_FIRST_BIT
bool
-config GENERIC_FIND_NEXT_BIT
- bool
-
-config GENERIC_FIND_BIT_LE
- bool
-
-config GENERIC_FIND_LAST_BIT
- bool
- default y
-
config CRC_CCITT
tristate "CRC-CCITT functions"
help
diff --git a/lib/Makefile b/lib/Makefile
index ef0f285..e2b8116 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -12,7 +12,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \
idr.o int_sqrt.o extable.o prio_tree.o \
sha1.o irq_regs.o reciprocal_div.o argv_split.o \
proportions.o prio_heap.o ratelimit.o show_mem.o \
- is_single_threaded.o plist.o decompress.o
+ is_single_threaded.o plist.o decompress.o find_next_bit.o
lib-$(CONFIG_MMU) += ioremap.o
lib-$(CONFIG_SMP) += cpumask.o
@@ -21,7 +21,8 @@ lib-y += kobject.o kref.o klist.o
obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
- string_helpers.o gcd.o lcm.o list_sort.o uuid.o flex_array.o
+ string_helpers.o gcd.o lcm.o list_sort.o uuid.o flex_array.o \
+ find_last_bit.o
obj-y += kstrtox.o
obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
@@ -38,10 +39,6 @@ obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
-lib-$(CONFIG_GENERIC_FIND_FIRST_BIT) += find_next_bit.o
-lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o
-lib-$(CONFIG_GENERIC_FIND_BIT_LE) += find_next_bit.o
-obj-$(CONFIG_GENERIC_FIND_LAST_BIT) += find_last_bit.o
CFLAGS_hweight.o = $(subst $(quote),,$(CONFIG_ARCH_HWEIGHT_CFLAGS))
obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
diff --git a/lib/find_next_bit.c b/lib/find_next_bit.c
index c02d09f..4bd75a7 100644
--- a/lib/find_next_bit.c
+++ b/lib/find_next_bit.c
@@ -16,7 +16,6 @@
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
-#ifdef CONFIG_GENERIC_FIND_NEXT_BIT
#ifndef find_next_bit
/*
* Find the next set bit in a memory region.
@@ -107,9 +106,7 @@ found_middle:
}
EXPORT_SYMBOL(find_next_zero_bit);
#endif
-#endif /* CONFIG_GENERIC_FIND_NEXT_BIT */
-#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
#ifndef find_first_bit
/*
* Find the first set bit in a memory region.
@@ -165,10 +162,8 @@ found:
}
EXPORT_SYMBOL(find_first_zero_bit);
#endif
-#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
#ifdef __BIG_ENDIAN
-#ifdef CONFIG_GENERIC_FIND_BIT_LE
/* include/linux/byteorder does not support "unsigned long" type */
static inline unsigned long ext2_swabp(const unsigned long * x)
@@ -287,5 +282,4 @@ found_middle_swap:
EXPORT_SYMBOL(find_next_bit_le);
#endif
-#endif /* CONFIG_GENERIC_FIND_BIT_LE */
#endif /* __BIG_ENDIAN */
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 4/7] arch: remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT}
2011-04-27 13:20 ` [PATCH v3 4/7] arch: remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
0 siblings, 0 replies; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd
Cc: Akinobu Mita, Russell King, Martin Schwidefsky, Heiko Carstens
By the previous style change, CONFIG_GENERIC_FIND_NEXT_BIT,
CONFIG_GENERIC_FIND_BIT_LE, and CONFIG_GENERIC_FIND_LAST_BIT are not used
to test for existence of find bitops anymore.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
---
Changes from previous submission:
- Add Acked-by: line
- No change in the patch itself
arch/alpha/Kconfig | 4 ----
arch/blackfin/Kconfig | 3 ---
arch/cris/Kconfig | 4 ----
arch/frv/Kconfig | 8 --------
arch/h8300/Kconfig | 8 --------
arch/ia64/Kconfig | 4 ----
arch/m32r/Kconfig | 8 --------
arch/m68k/Kconfig.nommu | 4 ----
arch/microblaze/Kconfig | 6 ------
arch/mips/Kconfig | 8 --------
arch/mn10300/Kconfig | 3 ---
arch/parisc/Kconfig | 8 --------
arch/powerpc/Kconfig | 8 --------
arch/score/Kconfig | 3 ---
arch/sh/Kconfig | 6 ------
arch/sparc/Kconfig | 8 --------
arch/tile/Kconfig | 1 -
arch/um/Kconfig.x86 | 1 -
arch/x86/Kconfig | 1 -
arch/xtensa/Kconfig | 6 ------
include/linux/bitops.h | 2 --
lib/Kconfig | 10 ----------
lib/Makefile | 9 +++------
lib/find_next_bit.c | 6 ------
24 files changed, 3 insertions(+), 126 deletions(-)
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 9808998..1e3fd03 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -40,10 +40,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
config GENERIC_CALIBRATE_DELAY
bool
default y
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 8addb12..f465e10 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -45,9 +45,6 @@ config GENERIC_BUG
config ZONE_DMA
def_bool y
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
config GENERIC_GPIO
def_bool y
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index a6d0306..b6b94a2 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -31,10 +31,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 064f621..cb884e4 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -19,14 +19,6 @@ config RWSEM_GENERIC_SPINLOCK
config RWSEM_XCHGADD_ALGORITHM
bool
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index e20322f..091ed61 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -41,14 +41,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index e5cc56a..38280ef 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -78,10 +78,6 @@ config HUGETLB_PAGE_SIZE_VARIABLE
depends on HUGETLB_PAGE
default y
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
config GENERIC_CALIBRATE_DELAY
bool
default y
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 736b808..85b44e8 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -256,14 +256,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/m68k/Kconfig.nommu b/arch/m68k/Kconfig.nommu
index 273bcca..fc98f9b 100644
--- a/arch/m68k/Kconfig.nommu
+++ b/arch/m68k/Kconfig.nommu
@@ -2,10 +2,6 @@ config FPU
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
config GENERIC_GPIO
bool
default n
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index eccdefe..e446bab 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -33,12 +33,6 @@ config ARCH_HAS_ILOG2_U32
config ARCH_HAS_ILOG2_U64
def_bool n
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
-config GENERIC_FIND_BIT_LE
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8e256cc..319c0a1 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -774,14 +774,6 @@ config ARCH_SUPPORTS_OPROFILE
bool
default y if !MIPS_MT_SMTC
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index feaf09c..1f87034 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -44,9 +44,6 @@ config GENERIC_CALIBRATE_DELAY
config GENERIC_CMOS_UPDATE
def_bool n
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 69ff049..65adc86 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -47,14 +47,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_BUG
bool
default y
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8f4d50b..17d0ddc 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -91,14 +91,6 @@ config GENERIC_HWEIGHT
bool
default y
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_GPIO
bool
help
diff --git a/arch/score/Kconfig b/arch/score/Kconfig
index e73bc78..288add8 100644
--- a/arch/score/Kconfig
+++ b/arch/score/Kconfig
@@ -43,9 +43,6 @@ config NO_DMA
config RWSEM_GENERIC_SPINLOCK
def_bool y
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 4b89da2..b20a2da 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -71,12 +71,6 @@ config GENERIC_CSUM
def_bool y
depends on SUPERH64
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
-config GENERIC_FIND_BIT_LE
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index e560d10..9d7c2ff 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -189,14 +189,6 @@ config RWSEM_XCHGADD_ALGORITHM
bool
default y if SPARC64
-config GENERIC_FIND_NEXT_BIT
- bool
- default y
-
-config GENERIC_FIND_BIT_LE
- bool
- default y
-
config GENERIC_HWEIGHT
bool
default y if !ULTRA_HAS_POPULATION_COUNT
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index e32b0c2..a1f4642 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -5,7 +5,6 @@ config TILE
def_bool y
select HAVE_KVM if !TILEGX
select GENERIC_FIND_FIRST_BIT
- select GENERIC_FIND_NEXT_BIT
select USE_GENERIC_SMP_HELPERS
select CC_OPTIMIZE_FOR_SIZE
select HAVE_GENERIC_HARDIRQS
diff --git a/arch/um/Kconfig.x86 b/arch/um/Kconfig.x86
index a9da516..c349960 100644
--- a/arch/um/Kconfig.x86
+++ b/arch/um/Kconfig.x86
@@ -15,7 +15,6 @@ endmenu
config UML_X86
def_bool y
select GENERIC_FIND_FIRST_BIT
- select GENERIC_FIND_NEXT_BIT
config 64BIT
bool
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index cc6c53a..2617e00 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -65,7 +65,6 @@ config X86
select HAVE_GENERIC_HARDIRQS
select HAVE_SPARSE_IRQ
select GENERIC_FIND_FIRST_BIT
- select GENERIC_FIND_NEXT_BIT
select GENERIC_IRQ_PROBE
select GENERIC_PENDING_IRQ if SMP
select GENERIC_IRQ_SHOW
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 7c275f5..5d43c1f 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -20,12 +20,6 @@ config XTENSA
config RWSEM_XCHGADD_ALGORITHM
def_bool y
-config GENERIC_FIND_NEXT_BIT
- def_bool y
-
-config GENERIC_FIND_BIT_LE
- def_bool y
-
config GENERIC_HWEIGHT
def_bool y
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 4829252..a3ef66a 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -148,7 +148,6 @@ static inline unsigned long __ffs64(u64 word)
#ifdef __KERNEL__
-#ifdef CONFIG_GENERIC_FIND_LAST_BIT
#ifndef find_last_bit
/**
* find_last_bit - find the last set bit in a memory region
@@ -160,7 +159,6 @@ static inline unsigned long __ffs64(u64 word)
extern unsigned long find_last_bit(const unsigned long *addr,
unsigned long size);
#endif
-#endif /* CONFIG_GENERIC_FIND_LAST_BIT */
#endif /* __KERNEL__ */
#endif
diff --git a/lib/Kconfig b/lib/Kconfig
index 9c10e38..830181c 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -19,16 +19,6 @@ config RATIONAL
config GENERIC_FIND_FIRST_BIT
bool
-config GENERIC_FIND_NEXT_BIT
- bool
-
-config GENERIC_FIND_BIT_LE
- bool
-
-config GENERIC_FIND_LAST_BIT
- bool
- default y
-
config CRC_CCITT
tristate "CRC-CCITT functions"
help
diff --git a/lib/Makefile b/lib/Makefile
index ef0f285..e2b8116 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -12,7 +12,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \
idr.o int_sqrt.o extable.o prio_tree.o \
sha1.o irq_regs.o reciprocal_div.o argv_split.o \
proportions.o prio_heap.o ratelimit.o show_mem.o \
- is_single_threaded.o plist.o decompress.o
+ is_single_threaded.o plist.o decompress.o find_next_bit.o
lib-$(CONFIG_MMU) += ioremap.o
lib-$(CONFIG_SMP) += cpumask.o
@@ -21,7 +21,8 @@ lib-y += kobject.o kref.o klist.o
obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
- string_helpers.o gcd.o lcm.o list_sort.o uuid.o flex_array.o
+ string_helpers.o gcd.o lcm.o list_sort.o uuid.o flex_array.o \
+ find_last_bit.o
obj-y += kstrtox.o
obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
@@ -38,10 +39,6 @@ obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
-lib-$(CONFIG_GENERIC_FIND_FIRST_BIT) += find_next_bit.o
-lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o
-lib-$(CONFIG_GENERIC_FIND_BIT_LE) += find_next_bit.o
-obj-$(CONFIG_GENERIC_FIND_LAST_BIT) += find_last_bit.o
CFLAGS_hweight.o = $(subst $(quote),,$(CONFIG_ARCH_HWEIGHT_CFLAGS))
obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
diff --git a/lib/find_next_bit.c b/lib/find_next_bit.c
index c02d09f..4bd75a7 100644
--- a/lib/find_next_bit.c
+++ b/lib/find_next_bit.c
@@ -16,7 +16,6 @@
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
-#ifdef CONFIG_GENERIC_FIND_NEXT_BIT
#ifndef find_next_bit
/*
* Find the next set bit in a memory region.
@@ -107,9 +106,7 @@ found_middle:
}
EXPORT_SYMBOL(find_next_zero_bit);
#endif
-#endif /* CONFIG_GENERIC_FIND_NEXT_BIT */
-#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
#ifndef find_first_bit
/*
* Find the first set bit in a memory region.
@@ -165,10 +162,8 @@ found:
}
EXPORT_SYMBOL(find_first_zero_bit);
#endif
-#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
#ifdef __BIG_ENDIAN
-#ifdef CONFIG_GENERIC_FIND_BIT_LE
/* include/linux/byteorder does not support "unsigned long" type */
static inline unsigned long ext2_swabp(const unsigned long * x)
@@ -287,5 +282,4 @@ found_middle_swap:
EXPORT_SYMBOL(find_next_bit_le);
#endif
-#endif /* CONFIG_GENERIC_FIND_BIT_LE */
#endif /* __BIG_ENDIAN */
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 5/7] arm: use asm-generic/bitops/le.h
2011-04-27 13:20 [PATCH v3 0/7] remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
` (3 preceding siblings ...)
2011-04-27 13:20 ` [PATCH v3 4/7] arch: remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
2011-04-27 13:20 ` [PATCH v3 6/7] s390: " Akinobu Mita
2011-04-27 13:20 ` [PATCH v3 7/7] m68knommu: use generic find_next_bit_le() Akinobu Mita
6 siblings, 0 replies; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd
Cc: Akinobu Mita, Martin Schwidefsky, Heiko Carstens, Greg Ungerer
The previous style change enables to use asm-generic/bitops/le.h on arm.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Greg Ungerer <gerg@uclinux.org>
---
Changes from previous submission:
- Add Acked-by: line
- No change in the patch itself
arch/arm/include/asm/bitops.h | 43 ++++------------------------------------
1 files changed, 5 insertions(+), 38 deletions(-)
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 18a024b..b4892a0 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -203,8 +203,6 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
#define find_first_bit(p,sz) _find_first_bit_le(p,sz)
#define find_next_bit(p,sz,off) _find_next_bit_le(p,sz,off)
-#define WORD_BITOFF_TO_LE(x) ((x))
-
#else
/*
* These are the big endian, atomic definitions.
@@ -214,8 +212,6 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
#define find_first_bit(p,sz) _find_first_bit_be(p,sz)
#define find_next_bit(p,sz,off) _find_next_bit_be(p,sz,off)
-#define WORD_BITOFF_TO_LE(x) ((x) ^ 0x18)
-
#endif
#if __LINUX_ARM_ARCH__ < 5
@@ -287,40 +283,7 @@ static inline int fls(int x)
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h>
-static inline void __set_bit_le(int nr, void *addr)
-{
- __set_bit(WORD_BITOFF_TO_LE(nr), addr);
-}
-
-static inline void __clear_bit_le(int nr, void *addr)
-{
- __clear_bit(WORD_BITOFF_TO_LE(nr), addr);
-}
-
-static inline int __test_and_set_bit_le(int nr, void *addr)
-{
- return __test_and_set_bit(WORD_BITOFF_TO_LE(nr), addr);
-}
-
-static inline int test_and_set_bit_le(int nr, void *addr)
-{
- return test_and_set_bit(WORD_BITOFF_TO_LE(nr), addr);
-}
-
-static inline int __test_and_clear_bit_le(int nr, void *addr)
-{
- return __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), addr);
-}
-
-static inline int test_and_clear_bit_le(int nr, void *addr)
-{
- return test_and_clear_bit(WORD_BITOFF_TO_LE(nr), addr);
-}
-
-static inline int test_bit_le(int nr, const void *addr)
-{
- return test_bit(WORD_BITOFF_TO_LE(nr), addr);
-}
+#ifdef __ARMEB__
static inline int find_first_zero_bit_le(const void *p, unsigned size)
{
@@ -340,6 +303,10 @@ static inline int find_next_bit_le(const void *p, int size, int offset)
}
#define find_next_bit_le find_next_bit_le
+#endif
+
+#include <asm-generic/bitops/le.h>
+
/*
* Ext2 is defined to use little-endian byte ordering.
*/
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 6/7] s390: use asm-generic/bitops/le.h
2011-04-27 13:20 [PATCH v3 0/7] remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
` (4 preceding siblings ...)
2011-04-27 13:20 ` [PATCH v3 5/7] arm: use asm-generic/bitops/le.h Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
2011-04-27 13:20 ` Akinobu Mita
2011-04-27 13:20 ` [PATCH v3 7/7] m68knommu: use generic find_next_bit_le() Akinobu Mita
6 siblings, 1 reply; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd
Cc: Akinobu Mita, Russell King, Martin Schwidefsky, Heiko Carstens,
Greg Ungerer
The previous style change enables to use asm-generic/bitops/le.h on s390.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Greg Ungerer <gerg@uclinux.org>
---
Changes from previous submission:
- Add Acked-by: line
- No change in the patch itself
arch/s390/include/asm/bitops.h | 37 ++-----------------------------------
1 files changed, 2 insertions(+), 35 deletions(-)
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 426c974..667c6e9 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -746,41 +746,6 @@ static inline int sched_find_first_bit(unsigned long *b)
* 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
*/
-static inline void __set_bit_le(unsigned long nr, void *addr)
-{
- __set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline void __clear_bit_le(unsigned long nr, void *addr)
-{
- __clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int __test_and_set_bit_le(unsigned long nr, void *addr)
-{
- return __test_and_set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int test_and_set_bit_le(unsigned long nr, void *addr)
-{
- return test_and_set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int __test_and_clear_bit_le(unsigned long nr, void *addr)
-{
- return __test_and_clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int test_and_clear_bit_le(unsigned long nr, void *addr)
-{
- return test_and_clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int test_bit_le(unsigned long nr, const void *addr)
-{
- return test_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
static inline int find_first_zero_bit_le(void *vaddr, unsigned int size)
{
unsigned long bytes, bits;
@@ -865,6 +830,8 @@ static inline int find_next_bit_le(void *vaddr, unsigned long size,
}
#define find_next_bit_le find_next_bit_le
+#include <asm-generic/bitops/le.h>
+
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_bit_le(nr, addr)
#define ext2_clear_bit_atomic(lock, nr, addr) \
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 6/7] s390: use asm-generic/bitops/le.h
2011-04-27 13:20 ` [PATCH v3 6/7] s390: " Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
0 siblings, 0 replies; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd
Cc: Akinobu Mita, Russell King, Martin Schwidefsky, Heiko Carstens,
Greg Ungerer
The previous style change enables to use asm-generic/bitops/le.h on s390.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Greg Ungerer <gerg@uclinux.org>
---
Changes from previous submission:
- Add Acked-by: line
- No change in the patch itself
arch/s390/include/asm/bitops.h | 37 ++-----------------------------------
1 files changed, 2 insertions(+), 35 deletions(-)
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 426c974..667c6e9 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -746,41 +746,6 @@ static inline int sched_find_first_bit(unsigned long *b)
* 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
*/
-static inline void __set_bit_le(unsigned long nr, void *addr)
-{
- __set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline void __clear_bit_le(unsigned long nr, void *addr)
-{
- __clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int __test_and_set_bit_le(unsigned long nr, void *addr)
-{
- return __test_and_set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int test_and_set_bit_le(unsigned long nr, void *addr)
-{
- return test_and_set_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int __test_and_clear_bit_le(unsigned long nr, void *addr)
-{
- return __test_and_clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int test_and_clear_bit_le(unsigned long nr, void *addr)
-{
- return test_and_clear_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
-static inline int test_bit_le(unsigned long nr, const void *addr)
-{
- return test_bit(nr ^ (__BITOPS_WORDSIZE - 8), addr);
-}
-
static inline int find_first_zero_bit_le(void *vaddr, unsigned int size)
{
unsigned long bytes, bits;
@@ -865,6 +830,8 @@ static inline int find_next_bit_le(void *vaddr, unsigned long size,
}
#define find_next_bit_le find_next_bit_le
+#include <asm-generic/bitops/le.h>
+
#define ext2_set_bit_atomic(lock, nr, addr) \
test_and_set_bit_le(nr, addr)
#define ext2_clear_bit_atomic(lock, nr, addr) \
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 7/7] m68knommu: use generic find_next_bit_le()
2011-04-27 13:20 [PATCH v3 0/7] remove CONFIG_GENERIC_FIND_{NEXT_BIT,BIT_LE,LAST_BIT} Akinobu Mita
` (5 preceding siblings ...)
2011-04-27 13:20 ` [PATCH v3 6/7] s390: " Akinobu Mita
@ 2011-04-27 13:20 ` Akinobu Mita
6 siblings, 0 replies; 17+ messages in thread
From: Akinobu Mita @ 2011-04-27 13:20 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm, arnd; +Cc: Akinobu Mita, Greg Ungerer
The implementation of find_next_bit_le() on m68knommu is
identical with the generic implementation of find_next_bit_le().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
---
arch/m68k/include/asm/bitops_no.h | 46 +-----------------------------------
1 files changed, 2 insertions(+), 44 deletions(-)
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index cd229fb..c4250ae 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -337,50 +337,8 @@ found_middle:
}
#define find_next_zero_bit_le find_next_zero_bit_le
-static inline unsigned long find_next_bit_le(const void *addr, unsigned
- long size, unsigned long offset)
-{
- const unsigned long *p = addr;
- unsigned long result = offset & ~(BITS_PER_LONG - 1);
- unsigned long tmp;
-
- if (offset >= size)
- return size;
- p += offset / BITS_PER_LONG;
- size -= result;
- offset &= (BITS_PER_LONG - 1UL);
- if (offset) {
- tmp = __swab32(*(p++));
- tmp &= (~0UL << offset);
- if (size < BITS_PER_LONG)
- goto found_first;
- if (tmp)
- goto found_middle;
- size -= BITS_PER_LONG;
- result += BITS_PER_LONG;
- }
-
- while (size & ~(BITS_PER_LONG - 1)) {
- tmp = *(p++);
- if (tmp)
- goto found_middle_swap;
- result += BITS_PER_LONG;
- size -= BITS_PER_LONG;
- }
- if (!size)
- return result;
- tmp = __swab32(*p);
-found_first:
- tmp &= (~0UL >> (BITS_PER_LONG - size));
- if (tmp == 0UL) /* Are any bits set? */
- return result + size; /* Nope. */
-found_middle:
- return result + __ffs(tmp);
-
-found_middle_swap:
- return result + __ffs(__swab32(tmp));
-}
-#define find_next_bit_le find_next_bit_le
+extern unsigned long find_next_bit_le(const void *addr,
+ unsigned long size, unsigned long offset);
#endif /* __KERNEL__ */
--
1.7.4.4
^ permalink raw reply related [flat|nested] 17+ messages in thread