diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-03-26 04:39:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:57:12 -0500 |
commit | 2875aef8bd0e42367a66a78ef7abe10f3bba27b5 (patch) | |
tree | 44f81fa0e5c3f5bcf90eb1d6326c1eff9915dfbd /arch | |
parent | 1cc2b9943b7b3a8d526aa8be5450d3ec083c3de4 (diff) |
[PATCH] bitops: ia64: use generic bitops
- remove generic_fls64()
- remove find_{next,first}{,_zero}_bit()
- remove ext2_{set,clear,test,find_first_zero,find_next_zero}_bit()
- remove minix_{test,set,test_and_clear,test,find_first_zero}_bit()
- remove sched_find_first_bit()
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/Kconfig | 4 | ||||
-rw-r--r-- | arch/ia64/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/ia64/lib/bitop.c | 88 |
3 files changed, 5 insertions, 89 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index d790a6d90261..edffe25a477a 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -34,6 +34,10 @@ config RWSEM_XCHGADD_ALGORITHM | |||
34 | bool | 34 | bool |
35 | default y | 35 | default y |
36 | 36 | ||
37 | config GENERIC_FIND_NEXT_BIT | ||
38 | bool | ||
39 | default y | ||
40 | |||
37 | config GENERIC_CALIBRATE_DELAY | 41 | config GENERIC_CALIBRATE_DELAY |
38 | bool | 42 | bool |
39 | default y | 43 | default y |
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile index ac64664a1807..d8536a2c22a9 100644 --- a/arch/ia64/lib/Makefile +++ b/arch/ia64/lib/Makefile | |||
@@ -6,7 +6,7 @@ obj-y := io.o | |||
6 | 6 | ||
7 | lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ | 7 | lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \ |
8 | __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \ | 8 | __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \ |
9 | bitop.o checksum.o clear_page.o csum_partial_copy.o \ | 9 | checksum.o clear_page.o csum_partial_copy.o \ |
10 | clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ | 10 | clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o \ |
11 | flush.o ip_fast_csum.o do_csum.o \ | 11 | flush.o ip_fast_csum.o do_csum.o \ |
12 | memset.o strlen.o | 12 | memset.o strlen.o |
diff --git a/arch/ia64/lib/bitop.c b/arch/ia64/lib/bitop.c deleted file mode 100644 index 82e299c8464e..000000000000 --- a/arch/ia64/lib/bitop.c +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | #include <linux/compiler.h> | ||
2 | #include <linux/types.h> | ||
3 | #include <asm/intrinsics.h> | ||
4 | #include <linux/module.h> | ||
5 | #include <linux/bitops.h> | ||
6 | |||
7 | /* | ||
8 | * Find next zero bit in a bitmap reasonably efficiently.. | ||
9 | */ | ||
10 | |||
11 | int __find_next_zero_bit (const void *addr, unsigned long size, unsigned long offset) | ||
12 | { | ||
13 | unsigned long *p = ((unsigned long *) addr) + (offset >> 6); | ||
14 | unsigned long result = offset & ~63UL; | ||
15 | unsigned long tmp; | ||
16 | |||
17 | if (offset >= size) | ||
18 | return size; | ||
19 | size -= result; | ||
20 | offset &= 63UL; | ||
21 | if (offset) { | ||
22 | tmp = *(p++); | ||
23 | tmp |= ~0UL >> (64-offset); | ||
24 | if (size < 64) | ||
25 | goto found_first; | ||
26 | if (~tmp) | ||
27 | goto found_middle; | ||
28 | size -= 64; | ||
29 | result += 64; | ||
30 | } | ||
31 | while (size & ~63UL) { | ||
32 | if (~(tmp = *(p++))) | ||
33 | goto found_middle; | ||
34 | result += 64; | ||
35 | size -= 64; | ||
36 | } | ||
37 | if (!size) | ||
38 | return result; | ||
39 | tmp = *p; | ||
40 | found_first: | ||
41 | tmp |= ~0UL << size; | ||
42 | if (tmp == ~0UL) /* any bits zero? */ | ||
43 | return result + size; /* nope */ | ||
44 | found_middle: | ||
45 | return result + ffz(tmp); | ||
46 | } | ||
47 | EXPORT_SYMBOL(__find_next_zero_bit); | ||
48 | |||
49 | /* | ||
50 | * Find next bit in a bitmap reasonably efficiently.. | ||
51 | */ | ||
52 | int __find_next_bit(const void *addr, unsigned long size, unsigned long offset) | ||
53 | { | ||
54 | unsigned long *p = ((unsigned long *) addr) + (offset >> 6); | ||
55 | unsigned long result = offset & ~63UL; | ||
56 | unsigned long tmp; | ||
57 | |||
58 | if (offset >= size) | ||
59 | return size; | ||
60 | size -= result; | ||
61 | offset &= 63UL; | ||
62 | if (offset) { | ||
63 | tmp = *(p++); | ||
64 | tmp &= ~0UL << offset; | ||
65 | if (size < 64) | ||
66 | goto found_first; | ||
67 | if (tmp) | ||
68 | goto found_middle; | ||
69 | size -= 64; | ||
70 | result += 64; | ||
71 | } | ||
72 | while (size & ~63UL) { | ||
73 | if ((tmp = *(p++))) | ||
74 | goto found_middle; | ||
75 | result += 64; | ||
76 | size -= 64; | ||
77 | } | ||
78 | if (!size) | ||
79 | return result; | ||
80 | tmp = *p; | ||
81 | found_first: | ||
82 | tmp &= ~0UL >> (64-size); | ||
83 | if (tmp == 0UL) /* Are any bits set? */ | ||
84 | return result + size; /* Nope. */ | ||
85 | found_middle: | ||
86 | return result + __ffs(tmp); | ||
87 | } | ||
88 | EXPORT_SYMBOL(__find_next_bit); | ||