aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bitmap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c
index d2cd50cd4f5d..45e7d14ebdfd 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -104,17 +104,17 @@ EXPORT_SYMBOL(__bitmap_complement);
104 * @dst : destination bitmap 104 * @dst : destination bitmap
105 * @src : source bitmap 105 * @src : source bitmap
106 * @shift : shift by this many bits 106 * @shift : shift by this many bits
107 * @bits : bitmap size, in bits 107 * @nbits : bitmap size, in bits
108 * 108 *
109 * Shifting right (dividing) means moving bits in the MS -> LS bit 109 * Shifting right (dividing) means moving bits in the MS -> LS bit
110 * direction. Zeros are fed into the vacated MS positions and the 110 * direction. Zeros are fed into the vacated MS positions and the
111 * LS bits shifted off the bottom are lost. 111 * LS bits shifted off the bottom are lost.
112 */ 112 */
113void __bitmap_shift_right(unsigned long *dst, 113void __bitmap_shift_right(unsigned long *dst, const unsigned long *src,
114 const unsigned long *src, int shift, int bits) 114 unsigned shift, unsigned nbits)
115{ 115{
116 int k, lim = BITS_TO_LONGS(bits), left = bits % BITS_PER_LONG; 116 unsigned k, lim = BITS_TO_LONGS(nbits), left = nbits % BITS_PER_LONG;
117 int off = shift/BITS_PER_LONG, rem = shift % BITS_PER_LONG; 117 unsigned off = shift/BITS_PER_LONG, rem = shift % BITS_PER_LONG;
118 unsigned long mask = (1UL << left) - 1; 118 unsigned long mask = (1UL << left) - 1;
119 for (k = 0; off + k < lim; ++k) { 119 for (k = 0; off + k < lim; ++k) {
120 unsigned long upper, lower; 120 unsigned long upper, lower;