Commit 65b4ee62 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Linus Torvalds
Browse files

lib: bitmap: remove unnecessary mask from bitmap_complement



Since the extra bits are "don't care", there is no reason to mask the
last word to the used bits when complementing.  This shaves off yet a
few bytes.
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3d6684f4
...@@ -225,7 +225,7 @@ static inline void bitmap_complement(unsigned long *dst, const unsigned long *sr ...@@ -225,7 +225,7 @@ static inline void bitmap_complement(unsigned long *dst, const unsigned long *sr
unsigned int nbits) unsigned int nbits)
{ {
if (small_const_nbits(nbits)) if (small_const_nbits(nbits))
*dst = ~(*src) & BITMAP_LAST_WORD_MASK(nbits); *dst = ~(*src);
else else
__bitmap_complement(dst, src, nbits); __bitmap_complement(dst, src, nbits);
} }
......
...@@ -93,7 +93,7 @@ void __bitmap_complement(unsigned long *dst, const unsigned long *src, unsigned ...@@ -93,7 +93,7 @@ void __bitmap_complement(unsigned long *dst, const unsigned long *src, unsigned
dst[k] = ~src[k]; dst[k] = ~src[k];
if (bits % BITS_PER_LONG) if (bits % BITS_PER_LONG)
dst[k] = ~src[k] & BITMAP_LAST_WORD_MASK(bits); dst[k] = ~src[k];
} }
EXPORT_SYMBOL(__bitmap_complement); EXPORT_SYMBOL(__bitmap_complement);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment