d54cfbfd314dd44f9ce922c61af117f635ad111b Issues on lib/bitmap.c file . lib/bitmap.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/bitmap.c b/lib/bitmap.c index c66da50..81e94d3 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -88,23 +88,23 @@ void __bitmap_shift_right(unsigned long *dst, const unsigned long *src, unsigned k, lim = BITS_TO_LONGS(nbits); unsigned off = shift/BITS_PER_LONG, rem = shift % BITS_PER_LONG; unsigned long mask = BITMAP_LAST_WORD_MASK(nbits); - for (k = 0; off + k < lim; ++k) { + for (k = 0; (off + k) < lim; ++k) { unsigned long upper, lower; /* * If shift is not word aligned, take lower rem bits of * word above and make them the top rem bits of result. */ - if (!rem || off + k + 1 >= lim) + if (!rem || ((off + k + 1) >= lim)) upper = 0; else { upper = src[off + k + 1]; - if (off + k + 1 == lim - 1) + if ((off + k + 1) == (lim - 1)) upper &= mask; upper <<= (BITS_PER_LONG - rem); } lower = src[off + k]; - if (off + k == lim - 1) + if ((off + k) == (lim - 1)) lower &= mask; lower >>= rem; dst[k] = lower | upper; @@ -140,7 +140,7 @@ void __bitmap_shift_left(unsigned long *dst, const unsigned long *src, * If shift is not word aligned, take upper rem bits of * word below and make them the bottom rem bits of result. */ - if (rem && k > 0) + if (rem && (k > 0)) lower = src[k - 1] >> (BITS_PER_LONG - rem); else lower = 0; @@ -164,7 +164,7 @@ int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, if (bits % BITS_PER_LONG) result |= (dst[k] = bitmap1[k] & bitmap2[k] & BITMAP_LAST_WORD_MASK(bits)); - return result != 0; + return (result != 0); } EXPORT_SYMBOL(__bitmap_and); @@ -202,7 +202,7 @@ int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, if (bits % BITS_PER_LONG) result |= (dst[k] = bitmap1[k] & ~bitmap2[k] & BITMAP_LAST_WORD_MASK(bits)); - return result != 0; + return (result != 0); } EXPORT_SYMBOL(__bitmap_andnot); @@ -258,7 +258,7 @@ void bitmap_set(unsigned long *map, unsigned int start, int len) int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG); unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start); - while (len - bits_to_set >= 0) { + while ((len - bits_to_set) >= 0) { *p |= mask_to_set; len -= bits_to_set; bits_to_set = BITS_PER_LONG; @@ -279,7 +279,7 @@ void bitmap_clear(unsigned long *map, unsigned int start, int len) int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); - while (len - bits_to_clear >= 0) { + while ((len - bits_to_clear) >= 0) { *p &= ~mask_to_clear; len -= bits_to_clear; bits_to_clear = BITS_PER_LONG; @@ -394,7 +394,7 @@ int __bitmap_parse(const char *buf, unsigned int buflen, return -EINVAL; /* A '\0' or a ',' signal the end of the chunk */ - if (c == '\0' || c == ',') + if ((c == '\0') || (c == ',')) break; if (!isxdigit(c)) @@ -413,16 +413,16 @@ int __bitmap_parse(const char *buf, unsigned int buflen, } if (ndigits == totaldigits) return -EINVAL; - if (nchunks == 0 && chunk == 0) + if ((nchunks == 0) && (chunk == 0)) continue; __bitmap_shift_left(maskp, maskp, CHUNKSZ, nmaskbits); *maskp |= chunk; nchunks++; - nbits += (nchunks == 1) ? nbits_to_hold_value(chunk) : CHUNKSZ; + nbits += ((nchunks == 1) ? nbits_to_hold_value(chunk) : CHUNKSZ); if (nbits > nmaskbits) return -EOVERFLOW; - } while (buflen && c == ','); + } while (buflen && (c == ',')); return 0; } @@ -533,7 +533,7 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen, continue; /* A '\0' or a ',' signal the end of a cpu# or range */ - if (c == '\0' || c == ',') + if ((c == '\0') || (c == ',')) break; /* * whitespaces between digits are not allowed, @@ -578,7 +578,7 @@ static int __bitmap_parselist(const char *buf, unsigned int buflen, set_bit(a, maskp); a++; } - } while (buflen && c == ','); + } while (buflen && (c == ',')); return 0; } @@ -639,7 +639,7 @@ EXPORT_SYMBOL(bitmap_parselist_user); */ static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigned int nbits) { - if (pos >= nbits || !test_bit(pos, buf)) + if ((pos >= nbits) || !test_bit(pos, buf)) return -1; return __bitmap_weight(buf, pos); @@ -721,7 +721,7 @@ void bitmap_remap(unsigned long *dst, const unsigned long *src, for_each_set_bit(oldbit, src, nbits) { int n = bitmap_pos_to_ord(old, oldbit, nbits); - if (n < 0 || w == 0) + if ((n < 0) || (w == 0)) set_bit(oldbit, dst); /* identity map */ else set_bit(bitmap_ord_to_pos(new, n % w, nbits), dst); @@ -760,7 +760,7 @@ int bitmap_bitremap(int oldbit, const unsigned long *old, { int w = bitmap_weight(new, bits); int n = bitmap_pos_to_ord(old, oldbit, bits); - if (n < 0 || w == 0) + if ((n < 0) || (w == 0)) return oldbit; else return bitmap_ord_to_pos(new, n % w, bits); @@ -971,7 +971,7 @@ static int __reg_op(unsigned long *bitmap, unsigned int pos, int order, int reg_ * overflows if nbitsinlong == BITS_PER_LONG. */ mask = (1UL << (nbitsinlong - 1)); - mask += mask - 1; + mask += (mask - 1); mask <<= offset; switch (reg_op) { -- 2.7.4