]> sourceware.org Git - lvm2.git/commitdiff
Simplify dm_bitset_create. (ejt)
authorAlasdair Kergon <agk@redhat.com>
Mon, 19 Apr 2010 21:08:32 +0000 (21:08 +0000)
committerAlasdair Kergon <agk@redhat.com>
Mon, 19 Apr 2010 21:08:32 +0000 (21:08 +0000)
libdm/datastruct/bitset.c

index e3c31d75cf243408457c798c7f6f0e8093b0b34b..e8bec2ab7fadc37e14ef221e44c1f0738dfff8fc 100644 (file)
@@ -26,17 +26,14 @@ dm_bitset_t dm_bitset_create(struct dm_pool *mem, unsigned num_bits)
        
        if (mem)
                bs = dm_pool_zalloc(mem, size);
-       else
-               bs = dm_malloc(size);
+       else if ((bs = dm_malloc(size)))
+               memset(mem, 0, size);
 
        if (!bs)
                return NULL;
 
        *bs = num_bits;
 
-       if (!mem)
-               dm_bit_clear_all(bs);
-
        return bs;
 }
 
This page took 0.03238 seconds and 5 git commands to generate.