From: Andreas Herrmann Date: Wed, 18 Jun 2008 13:38:57 +0000 (+0200) Subject: x86: shrink pat_x_mtrr_type to its essentials X-Git-Tag: v2.6.27-rc1~1106^2~251^18~7 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=dd0c7c4903c29da9aa3bf33deecf064d190a0d81;p=linux-2.6-omap-h63xx.git x86: shrink pat_x_mtrr_type to its essentials Signed-off-by: Andreas Herrmann Cc: Venkatesh Pallipadi Cc: Suresh B Siddha Cc: Hugh Dickins Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index ac3a2b11eb3..227df3ca9bf 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c @@ -161,29 +161,21 @@ static DEFINE_SPINLOCK(memtype_lock); /* protects memtype list */ */ static unsigned long pat_x_mtrr_type(u64 start, u64 end, unsigned long req_type) { - u8 mtrr_type; - - /* - * We return the PAT request directly for types where PAT takes - * precedence with respect to MTRR and for UC_MINUS. - * Consistency checks with other PAT requests is done later - * while going through memtype list. - */ - if (req_type == _PAGE_CACHE_WC || - req_type == _PAGE_CACHE_UC_MINUS || - req_type == _PAGE_CACHE_UC) - return req_type; - /* * Look for MTRR hint to get the effective type in case where PAT * request is for WB. */ - mtrr_type = mtrr_type_lookup(start, end); - if (mtrr_type == MTRR_TYPE_UNCACHABLE) - return _PAGE_CACHE_UC; - if (mtrr_type == MTRR_TYPE_WRCOMB) - return _PAGE_CACHE_WC; - return _PAGE_CACHE_WB; + if (req_type == _PAGE_CACHE_WB) { + u8 mtrr_type; + + mtrr_type = mtrr_type_lookup(start, end); + if (mtrr_type == MTRR_TYPE_UNCACHABLE) + return _PAGE_CACHE_UC; + if (mtrr_type == MTRR_TYPE_WRCOMB) + return _PAGE_CACHE_WC; + } + + return req_type; } /*