diff options
author | Alasdair Kergon <agk@redhat.com> | 2010-04-19 21:08:32 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2010-04-19 21:08:32 +0000 |
commit | da336123c2e81e99696cf3284fcb597efebccb9f (patch) | |
tree | 0984f6cb3094ba1efe981168885f94f064d57f94 /libdm/datastruct | |
parent | 72ab7270e07afbc24f84985bb49c45cc4797646f (diff) | |
download | lvm2-da336123c2e81e99696cf3284fcb597efebccb9f.tar.gz lvm2-da336123c2e81e99696cf3284fcb597efebccb9f.tar.xz lvm2-da336123c2e81e99696cf3284fcb597efebccb9f.zip |
Simplify dm_bitset_create. (ejt)
Diffstat (limited to 'libdm/datastruct')
-rw-r--r-- | libdm/datastruct/bitset.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libdm/datastruct/bitset.c b/libdm/datastruct/bitset.c index e3c31d75..e8bec2ab 100644 --- a/libdm/datastruct/bitset.c +++ b/libdm/datastruct/bitset.c @@ -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; } |