summaryrefslogtreecommitdiff
path: root/include/asm-mips/div64.h
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-04-29 11:58:35 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 19:05:59 +0400
commitede9c697bc7513f210103fa77a9031e89726ae40 (patch)
treea48eaac7da2877aa5600e5b4e99dedabd4b4b6fb /include/asm-mips/div64.h
parentcdac75e6f2fec9abc21d0abb4e5d80720eeebb10 (diff)
downloadlinux-ede9c697bc7513f210103fa77a9031e89726ae40.tar.xz
Avoid divides in BITS_TO_LONGS
BITS_PER_LONG is a signed value (32 or 64) DIV_ROUND_UP(nr, BITS_PER_LONG) performs signed arithmetic if "nr" is signed too. Converting BITS_TO_LONGS(nr) to DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) makes sure compiler can perform a right shift, even if "nr" is a signed value, instead of an expensive integer divide. Applying this patch saves 141 bytes on x86 when CONFIG_CC_OPTIMIZE_FOR_SIZE=y and speedup bitmap operations. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-mips/div64.h')
0 files changed, 0 insertions, 0 deletions