diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-02-13 14:36:13 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-13 21:21:35 -0800 |
commit | dba94c2553da1928303c2a6c6410247c88cafc1d (patch) | |
tree | f6721644e3f883db6d2edccffad73756941b8c00 /lib/fdt_strerror.c | |
parent | cfac1d080a00544e5cecd2d7c9ebe3d6a5cc18e6 (diff) |
lib: bitmap: change bitmap_shift_left to take unsigned parameters
gcc can generate slightly better code for stuff like "nbits %
BITS_PER_LONG" when it knows nbits is not negative. Since negative size
bitmaps or shift amounts don't make sense, change these parameters of
bitmap_shift_right to unsigned.
If off >= lim (which requires shift >= nbits), k is initialized with a
large positive value, but since I've let k continue to be signed, the loop
will never run and dst will be zeroed as expected. Inside the loop, k is
guaranteed to be non-negative, so the fact that it is promoted to unsigned
in the various expressions it appears in is harmless.
Also use "shift" and "nbits" consistently for the parameter names.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/fdt_strerror.c')
0 files changed, 0 insertions, 0 deletions