linux/arch/x86/kernel/cpu/mtrr
Jan Beulich 1ba9a29414 x86/mm/mtrr: Fix alignment determination in range_to_mtrr()
With the variable operated on being of "unsigned long" type,
neither ffs() nor fls() are suitable to use on them, as those
truncate their arguments to 32 bits. Using __ffs() and __fls()
respectively at once eliminates the need to subtract 1 from their
results.

Additionally, with the alignment value subsequently used as a
shift count, it must be enforced to be less than BITS_PER_LONG
(and on 64-bit there's no need for it to be any smaller).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/4FF70D54020000780008E179@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-07-10 10:38:14 +02:00
..
amd.c x86, mtrr: Constify struct mtrr_ops 2010-02-01 11:20:43 -08:00
centaur.c x86, mtrr: Constify struct mtrr_ops 2010-02-01 11:20:43 -08:00
cleanup.c x86/mm/mtrr: Fix alignment determination in range_to_mtrr() 2012-07-10 10:38:14 +02:00
cyrix.c x86, mtrr: Constify struct mtrr_ops 2010-02-01 11:20:43 -08:00
generic.c Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
if.c x86, mtrr: Use explicit sizing and padding for the 64-bit ioctls 2012-03-01 12:48:52 -08:00
main.c mtrr: fix UP breakage caused during switch to stop_machine 2011-08-25 11:02:29 -07:00
Makefile x86, mtrr: Remove unused mtrr/state.c 2010-02-04 10:01:38 +01:00
mtrr.h x86, mtrr: Constify struct mtrr_ops 2010-02-01 11:20:43 -08:00