diff options
| author | Yury Norov <[email protected]> | 2015-04-16 19:44:00 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2015-04-17 13:03:56 +0000 |
| commit | 2afe27c718b669b551895595873611ac39cc31e3 (patch) | |
| tree | 69c4b547b6dc2332514757c7a93e2fce1c6692ff /lib/bitmap.c | |
| parent | ASoC: pcm512x: use DIV_ROUND_CLOSEST_ULL() from kernel.h (diff) | |
| download | kernel-2afe27c718b669b551895595873611ac39cc31e3.tar.gz kernel-2afe27c718b669b551895595873611ac39cc31e3.zip | |
lib/bitmap.c: bitmap_[empty,full]: remove code duplication
bitmap_empty() has its own implementation. But it's clearly as simple as:
find_first_bit(src, nbits) == nbits
The same is true for 'bitmap_full'.
Signed-off-by: Yury Norov <[email protected]>
Cc: George Spelvin <[email protected]>
Cc: Alexey Klimov <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/bitmap.c')
| -rw-r--r-- | lib/bitmap.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index d456f4c15a9f..64c0926f5dd8 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -42,36 +42,6 @@ * for the best explanations of this ordering. */ -int __bitmap_empty(const unsigned long *bitmap, unsigned int bits) -{ - unsigned int k, lim = bits/BITS_PER_LONG; - for (k = 0; k < lim; ++k) - if (bitmap[k]) - return 0; - - if (bits % BITS_PER_LONG) - if (bitmap[k] & BITMAP_LAST_WORD_MASK(bits)) - return 0; - - return 1; -} -EXPORT_SYMBOL(__bitmap_empty); - -int __bitmap_full(const unsigned long *bitmap, unsigned int bits) -{ - unsigned int k, lim = bits/BITS_PER_LONG; - for (k = 0; k < lim; ++k) - if (~bitmap[k]) - return 0; - - if (bits % BITS_PER_LONG) - if (~bitmap[k] & BITMAP_LAST_WORD_MASK(bits)) - return 0; - - return 1; -} -EXPORT_SYMBOL(__bitmap_full); - int __bitmap_equal(const unsigned long *bitmap1, const unsigned long *bitmap2, unsigned int bits) { |
