]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Rename bitmap_clear to bitmap_zero, remove CLEAR_BITMAP
authorAndrew Morton <akpm@osdl.org>
Mon, 12 Apr 2004 08:03:29 +0000 (01:03 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 12 Apr 2004 08:03:29 +0000 (01:03 -0700)
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.

arch/ia64/sn/kernel/sn2/sn2_smp.c
drivers/atm/lanai.c
drivers/ieee1394/ieee1394_types.h
drivers/scsi/atari_NCR5380.c
include/asm-generic/cpumask_array.h
include/asm-i386/mpspec.h
include/asm-x86_64/mpspec.h
include/linux/bitmap.h
include/linux/types.h
lib/bitmap.c
mm/page_alloc.c

index 3cfb3cd74d51d68f177de9c567be888d88e9dd84..e8bc389edebb14c1967818cf6ec23138f68758fb 100644 (file)
@@ -91,7 +91,7 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit
        short                   nasids[NR_NODES], nix;
        DECLARE_BITMAP(nodes_flushed, NR_NODES);
 
-       CLEAR_BITMAP(nodes_flushed, NR_NODES);
+       bitmap_zero(nodes_flushed, NR_NODES);
 
        i = 0;
 
index 402e78a5ac97fc50d5f47e92b2c2ea0d24faadd3..5a7037af6addafc501c126a56a79f32db3930a1f 100644 (file)
@@ -1743,7 +1743,7 @@ static void run_service(struct lanai_dev *lanai)
                read_lock(&vcc_sklist_lock);
                vci_bitfield_iterate(lanai, lanai->transmit_ready,
                    iter_transmit);
-               CLEAR_BITMAP(&lanai->transmit_ready, NUM_VCI);
+               bitmap_zero(lanai->transmit_ready, NUM_VCI);
                read_unlock(&vcc_sklist_lock);
        }
 }
@@ -2158,8 +2158,8 @@ static int __init lanai_dev_open(struct atm_dev *atmdev)
        /* Basic device fields */
        lanai->number = atmdev->number;
        lanai->num_vci = NUM_VCI;
-       CLEAR_BITMAP(&lanai->backlog_vccs, NUM_VCI);
-       CLEAR_BITMAP(&lanai->transmit_ready, NUM_VCI);
+       bitmap_zero(lanai->backlog_vccs, NUM_VCI);
+       bitmap_zero(lanai->transmit_ready, NUM_VCI);
        lanai->naal0 = 0;
 #ifdef USE_POWERDOWN
        lanai->nbound = 0;
index 552667142ce1d46003510477a8631bb53cda53fb..3165609ec1ec3019a03f19fa8e0ff7775466bc7d 100644 (file)
@@ -24,7 +24,7 @@ struct hpsb_tlabel_pool {
 
 #define HPSB_TPOOL_INIT(_tp)                   \
 do {                                           \
-       CLEAR_BITMAP((_tp)->pool, 64);          \
+       bitmap_zero((_tp)->pool, 64);           \
        spin_lock_init(&(_tp)->lock);           \
        (_tp)->next = 0;                        \
        (_tp)->allocations = 0;                 \
index cd8ddb7084a2daecf08e36738c791ccc50e5115f..5d1e78ebed834064afb8dba16aa69e77a131cd11 100644 (file)
@@ -329,7 +329,7 @@ static void __init init_tags( void )
     for( target = 0; target < 8; ++target ) {
        for( lun = 0; lun < 8; ++lun ) {
            ta = &TagAlloc[target][lun];
-           CLEAR_BITMAP( ta->allocated, MAX_TAGS );
+           bitmap_zero(ta->allocated, MAX_TAGS);
            ta->nr_allocated = 0;
            /* At the beginning, assume the maximum queue size we could
             * support (MAX_TAGS). This value will be decreased if the target
@@ -438,7 +438,7 @@ static void free_all_tags( void )
     for( target = 0; target < 8; ++target ) {
        for( lun = 0; lun < 8; ++lun ) {
            ta = &TagAlloc[target][lun];
-           CLEAR_BITMAP( ta->allocated, MAX_TAGS );
+           bitmap_zero(ta->allocated, MAX_TAGS);
            ta->nr_allocated = 0;
        }
     }
index bd5c49133c6c3dac8a2e7fb54769e9a75ad5cb20..c7e2db29dc537bce539c57a5fcc16cf0ce9c8e11 100644 (file)
@@ -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)
index 78bd12b7ae4221b0814526a3554d3e078f7c24d5..b376b093749c127bef7e75ed09d5caa01d3cc23f 100644 (file)
@@ -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)
index 896b99f11cec3d9ca9bf90a7e76ae5ff6df17e5c..cbe6058e9270927341fa83f786cd799dedf4dad8 100644 (file)
@@ -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)
index 2ad5fb97fa26581d10fa0b9220e18b93c884078b..81e73cdc1a62e7cfaaa577e41beee39d838e3086 100644 (file)
@@ -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)
index 93f5f36535614176b0b7d343dcb46623ae4e67ce..23c414f11cbefa55b85ff9f13585c8a632932dcb 100644 (file)
@@ -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>
index 602b919ef5510f32c7c90620ae21d74396150f4b..779d30365e46171451759fb65a294415490d82d0 100644 (file)
@@ -273,7 +273,7 @@ int bitmap_parse(const char __user *ubuf, unsigned int ubuflen,
        int c, old_c, totaldigits, ndigits, nchunks, nbits;
        u32 chunk;
 
-       bitmap_clear(maskp, nmaskbits);
+       bitmap_zero(maskp, nmaskbits);
 
        nchunks = nbits = totaldigits = c = 0;
        do {
index 6b4d5dc0c930066e2671eea6b606fac1336a53e2..8d3f6f46105e828d235fe082d96fe35f21dbaac9 100644 (file)
@@ -1222,7 +1222,7 @@ static void __init build_zonelists(pg_data_t *pgdat)
        local_node = pgdat->node_id;
        load = numnodes;
        prev_node = local_node;
-       CLEAR_BITMAP(used_mask, MAX_NUMNODES);
+       bitmap_zero(used_mask, MAX_NUMNODES);
        while ((node = find_next_best_node(local_node, used_mask)) >= 0) {
                /*
                 * We don't want to pressure a particular node.