lib: bitmap: change bitmap_shift_right to take unsigned parameters
[firefly-linux-kernel-4.4.55.git] / lib / bitmap.c
index d2cd50cd4f5dda75d639b3d00c159e31e5529d69..45e7d14ebdfdeb6403b900dd7b3e1cdc332e0b15 100644 (file)
@@ -104,17 +104,17 @@ EXPORT_SYMBOL(__bitmap_complement);
  *   @dst : destination bitmap
  *   @src : source bitmap
  *   @shift : shift by this many bits
- *   @bits : bitmap size, in bits
+ *   @nbits : bitmap size, in bits
  *
  * Shifting right (dividing) means moving bits in the MS -> LS bit
  * direction.  Zeros are fed into the vacated MS positions and the
  * LS bits shifted off the bottom are lost.
  */
-void __bitmap_shift_right(unsigned long *dst,
-                       const unsigned long *src, int shift, int bits)
+void __bitmap_shift_right(unsigned long *dst, const unsigned long *src,
+                       unsigned shift, unsigned nbits)
 {
-       int k, lim = BITS_TO_LONGS(bits), left = bits % BITS_PER_LONG;
-       int off = shift/BITS_PER_LONG, rem = shift % BITS_PER_LONG;
+       unsigned k, lim = BITS_TO_LONGS(nbits), left = nbits % BITS_PER_LONG;
+       unsigned off = shift/BITS_PER_LONG, rem = shift % BITS_PER_LONG;
        unsigned long mask = (1UL << left) - 1;
        for (k = 0; off + k < lim; ++k) {
                unsigned long upper, lower;