diff options
author | Mark Brown <broonie@kernel.org> | 2014-11-26 23:37:57 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-26 23:37:57 +0300 |
commit | cf2394f70cf7774a107fbaa1ef5010db4bd69baa (patch) | |
tree | e79e3e479d04213a67ecd47b31c7db648b0313c2 /lib/bitmap.c | |
parent | 45fc84c668ba6cc08cbae74042be838bf9283d98 (diff) | |
parent | 206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff) | |
download | linux-cf2394f70cf7774a107fbaa1ef5010db4bd69baa.tar.xz |
Merge tag 'v3.18-rc4' into regulator-max77802
Linux 3.18-rc4
Diffstat (limited to 'lib/bitmap.c')
-rw-r--r-- | lib/bitmap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index cd250a2e14cb..b499ab6ada29 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -131,7 +131,9 @@ void __bitmap_shift_right(unsigned long *dst, lower = src[off + k]; if (left && off + k == lim - 1) lower &= mask; - dst[k] = upper << (BITS_PER_LONG - rem) | lower >> rem; + dst[k] = lower >> rem; + if (rem) + dst[k] |= upper << (BITS_PER_LONG - rem); if (left && k == lim - 1) dst[k] &= mask; } @@ -172,7 +174,9 @@ void __bitmap_shift_left(unsigned long *dst, upper = src[k]; if (left && k == lim - 1) upper &= (1UL << left) - 1; - dst[k + off] = lower >> (BITS_PER_LONG - rem) | upper << rem; + dst[k + off] = upper << rem; + if (rem) + dst[k + off] |= lower >> (BITS_PER_LONG - rem); if (left && k + off == lim - 1) dst[k + off] &= (1UL << left) - 1; } |