summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-12 01:03:29 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-12 01:03:29 -0700
commit8447ac2688647d261af7a7397a53548a2a1afc13 (patch)
tree037865f6ae88dc9a22fd0418870a714593ff16c8 /include
parent6ab26f0a7443f4d4e2b13c31717088ad410cb64b (diff)
[PATCH] Rename bitmap_clear to bitmap_zero, remove CLEAR_BITMAP
From: Rusty Russell <rusty@rustcorp.com.au> clear_bit(n, addr) clears the nth bit. test_and_clear_bit(n, addr) clears the nth bit. cpu_clear(n, cpumask) clears the nth bit (vs. cpus_clear()). bitmap_clear(bitmap, n) clears out all the bits up to n. Moreover, there's a CLEAR_BITMAP() in linux/types.h which bitmap_clear() is a wrapper for. Rename bitmap_clear to bitmap_zero, which is harder to confuse (yes, it bit me), and make everyone use it.
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/cpumask_array.h2
-rw-r--r--include/asm-i386/mpspec.h2
-rw-r--r--include/asm-x86_64/mpspec.h2
-rw-r--r--include/linux/bitmap.h4
-rw-r--r--include/linux/types.h2
5 files changed, 5 insertions, 7 deletions
diff --git a/include/asm-generic/cpumask_array.h b/include/asm-generic/cpumask_array.h
index bd5c49133c6c..c7e2db29dc53 100644
--- a/include/asm-generic/cpumask_array.h
+++ b/include/asm-generic/cpumask_array.h
@@ -16,7 +16,7 @@
#define cpus_and(dst,src1,src2) bitmap_and((dst).mask,(src1).mask, (src2).mask, NR_CPUS)
#define cpus_or(dst,src1,src2) bitmap_or((dst).mask, (src1).mask, (src2).mask, NR_CPUS)
-#define cpus_clear(map) bitmap_clear((map).mask, NR_CPUS)
+#define cpus_clear(map) bitmap_zero((map).mask, NR_CPUS)
#define cpus_complement(map) bitmap_complement((map).mask, NR_CPUS)
#define cpus_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, NR_CPUS)
#define cpus_empty(map) bitmap_empty(map.mask, NR_CPUS)
diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h
index 78bd12b7ae42..b376b093749c 100644
--- a/include/asm-i386/mpspec.h
+++ b/include/asm-i386/mpspec.h
@@ -52,7 +52,7 @@ typedef struct physid_mask physid_mask_t;
#define physids_and(dst, src1, src2) bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
#define physids_or(dst, src1, src2) bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
-#define physids_clear(map) bitmap_clear((map).mask, MAX_APICS)
+#define physids_clear(map) bitmap_zero((map).mask, MAX_APICS)
#define physids_complement(map) bitmap_complement((map).mask, MAX_APICS)
#define physids_empty(map) bitmap_empty((map).mask, MAX_APICS)
#define physids_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, MAX_APICS)
diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h
index 896b99f11cec..cbe6058e9270 100644
--- a/include/asm-x86_64/mpspec.h
+++ b/include/asm-x86_64/mpspec.h
@@ -211,7 +211,7 @@ typedef struct physid_mask physid_mask_t;
#define physids_and(dst, src1, src2) bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
#define physids_or(dst, src1, src2) bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
-#define physids_clear(map) bitmap_clear((map).mask, MAX_APICS)
+#define physids_clear(map) bitmap_zero((map).mask, MAX_APICS)
#define physids_complement(map) bitmap_complement((map).mask, MAX_APICS)
#define physids_empty(map) bitmap_empty((map).mask, MAX_APICS)
#define physids_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, MAX_APICS)
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 2ad5fb97fa26..81e73cdc1a62 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -16,9 +16,9 @@ int bitmap_equal(const unsigned long *bitmap1,
unsigned long *bitmap2, int bits);
void bitmap_complement(unsigned long *bitmap, int bits);
-static inline void bitmap_clear(unsigned long *bitmap, int bits)
+static inline void bitmap_zero(unsigned long *bitmap, int bits)
{
- CLEAR_BITMAP((unsigned long *)bitmap, bits);
+ memset(bitmap, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long));
}
static inline void bitmap_fill(unsigned long *bitmap, int bits)
diff --git a/include/linux/types.h b/include/linux/types.h
index 93f5f3653561..23c414f11cbe 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -8,8 +8,6 @@
(((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
#define DECLARE_BITMAP(name,bits) \
unsigned long name[BITS_TO_LONGS(bits)]
-#define CLEAR_BITMAP(name,bits) \
- memset(name, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long))
#endif
#include <linux/posix_types.h>