mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Simplify dm_bitset_create. (ejt)
This commit is contained in:
parent
72ab7270e0
commit
da336123c2
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user