[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427234921-19737-4-git-send-email-toshi.kani@hp.com>
Date: Tue, 24 Mar 2015 16:08:37 -0600
From: Toshi Kani <toshi.kani@...com>
To: akpm@...ux-foundation.org, hpa@...or.com, tglx@...utronix.de,
mingo@...hat.com
Cc: linux-mm@...ck.org, x86@...nel.org, linux-kernel@...r.kernel.org,
dave.hansen@...el.com, Elliott@...com, pebolle@...cali.nl,
Toshi Kani <toshi.kani@...com>
Subject: [PATCH v4 3/7] mtrr, x86: Remove a wrong address check in __mtrr_type_lookup()
__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@...com>
---
arch/x86/kernel/cpu/mtrr/generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index a82e370..c5be327 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -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];
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists