lib: bitmap: remove redundant code from __bitmap_shift_right
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Fri, 13 Feb 2015 22:36:08 +0000 (14:36 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Feb 2015 05:21:35 +0000 (21:21 -0800)
commit97fb8e940bc56b157517c812c9c6cbfc83d48d78
tree08fcd4c971c7047ef80d724a5c060c2e9b1c4f7f
parent9d8a6b2a02c5fae53d47bfffaabd5f12bb6ec2c0
lib: bitmap: remove redundant code from __bitmap_shift_right

If the condition k==lim-1 is true, we must have off == 0 (otherwise, k
could never become that big).  But in that case we have upper == 0 and
hence dst[k] == (src[k] & mask) >> rem.  Since mask consists of a
consecutive range of bits starting from the LSB, anding dst[k] with mask
is a no-op.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/bitmap.c