X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fbitmap.c;h=2c9242e3fed01ca348b4171db2c0d89333fa357e;hb=18914b1884ebdbcd4d4454100502a23d1d2dba43;hp=ee6e58fce8f75f675c2688294b07e01655a4396e;hpb=b312362be6d9155b66f3a26d9159e0a680fbd6c5;p=linux-2.6-omap-h63xx.git diff --git a/lib/bitmap.c b/lib/bitmap.c index ee6e58fce8f..2c9242e3fed 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -97,10 +97,10 @@ EXPORT_SYMBOL(__bitmap_complement); /** * __bitmap_shift_right - logical right shift of the bits in a bitmap - * @dst - destination bitmap - * @src - source bitmap - * @nbits - shift by this many bits - * @bits - bitmap size, in bits + * @dst : destination bitmap + * @src : source bitmap + * @shift : shift by this many bits + * @bits : 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 @@ -141,10 +141,10 @@ EXPORT_SYMBOL(__bitmap_shift_right); /** * __bitmap_shift_left - logical left shift of the bits in a bitmap - * @dst - destination bitmap - * @src - source bitmap - * @nbits - shift by this many bits - * @bits - bitmap size, in bits + * @dst : destination bitmap + * @src : source bitmap + * @shift : shift by this many bits + * @bits : bitmap size, in bits * * Shifting left (multiplying) means moving bits in the LS -> MS * direction. Zeros are fed into the vacated LS bit positions @@ -469,6 +469,10 @@ int bitmap_scnlistprintf(char *buf, unsigned int buflen, /* current bit is 'cur', most recently seen range is [rbot, rtop] */ int cur, rbot, rtop; + if (buflen == 0) + return 0; + buf[0] = 0; + rbot = cur = find_first_bit(maskp, nmaskbits); while (cur < nmaskbits) { rtop = cur;