]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtrr, x86: remove a wrong address check in __mtrr_type_lookup()
authorToshi Kani <toshi.kani@hp.com>
Tue, 7 Apr 2015 23:57:07 +0000 (09:57 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 9 Apr 2015 09:07:13 +0000 (19:07 +1000)
__mtrr_type_lookup() checks MTRR fixed ranges when mtrr_state.have_fixed
is set and start is less than 0x100000.  However, the 'else if (start <
0x1000000)' in the code checks with a wrong address as it has an
extra-zero in the address.  The code still runs correctly as this check is
meaningless, though.

This patch replaces the wrong address check with 'else' with no condition.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Robert Elliott <Elliott@hp.com>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/kernel/cpu/mtrr/generic.c

index a82e370493738fab1db0cd1ea90abfb3c09e6412..c5be32701077cc5ff8c2f3b3eb96113422a46e16 100644 (file)
@@ -137,7 +137,7 @@ static u8 __mtrr_type_lookup(u64 start, u64 end, u64 *partial_end, int *repeat)
                        idx = 1 * 8;
                        idx += ((start - 0x80000) >> 14);
                        return mtrr_state.fixed_ranges[idx];
-               } else if (start < 0x1000000) {
+               } else {
                        idx = 3 * 8;
                        idx += ((start - 0xC0000) >> 12);
                        return mtrr_state.fixed_ranges[idx];