diff mbox

[4/9] x86/mtrr: drop unnecessary use_intel() macro

Message ID 1471390109-10407-5-git-send-email-cardoe@cardoe.com (mailing list archive)
State New, archived
Headers show

Commit Message

Douglas Goldstein Aug. 16, 2016, 11:28 p.m. UTC
The use_intel() macro always evaluates to true so don't bother using it.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/arch/x86/cpu/mtrr/main.c | 21 ++++-----------------
 xen/arch/x86/cpu/mtrr/mtrr.h |  1 -
 2 files changed, 4 insertions(+), 18 deletions(-)

Comments

Jan Beulich Aug. 17, 2016, 12:53 p.m. UTC | #1
>>> On 17.08.16 at 01:28, <cardoe@cardoe.com> wrote:
> The use_intel() macro always evaluates to true so don't bother using it.

Ah, here we go. But there are indentation issues again here.

Jan
diff mbox

Patch

diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c
index 5dd1f5d..6f0113a 100644
--- a/xen/arch/x86/cpu/mtrr/main.c
+++ b/xen/arch/x86/cpu/mtrr/main.c
@@ -82,12 +82,7 @@  static void __init set_num_var_ranges(void)
 {
 	unsigned long config = 0;
 
-	if (use_intel()) {
-		rdmsrl(MSR_MTRRcap, config);
-	} else if (is_cpu(AMD))
-		config = 2;
-	else if (is_cpu(CYRIX) || is_cpu(CENTAUR))
-		config = 8;
+    rdmsrl(MSR_MTRRcap, config);
 	num_var_ranges = config & 0xff;
 }
 
@@ -561,13 +556,12 @@  void __init mtrr_bp_init(void)
 
     set_num_var_ranges();
     init_table();
-    if (use_intel())
-        get_mtrr_state();
+    get_mtrr_state();
 }
 
 void mtrr_ap_init(void)
 {
-	if (!use_intel() || hold_mtrr_updates_on_aps)
+	if (hold_mtrr_updates_on_aps)
 		return;
 	/*
 	 * Ideally we should hold mtrr_mutex here to avoid mtrr entries changed,
@@ -596,30 +590,23 @@  void mtrr_save_state(void)
 
 void mtrr_aps_sync_begin(void)
 {
-	if (!use_intel())
-		return;
 	hold_mtrr_updates_on_aps = 1;
 }
 
 void mtrr_aps_sync_end(void)
 {
-	if (!use_intel())
-		return;
 	set_mtrr(~0U, 0, 0, 0);
 	hold_mtrr_updates_on_aps = 0;
 }
 
 void mtrr_bp_restore(void)
 {
-	if (!use_intel())
-		return;
 	mtrr_generic_set_all();
 }
 
 static int __init mtrr_init_finialize(void)
 {
-	if (use_intel())
-		mtrr_state_warn();
+    mtrr_state_warn();
 	return 0;
 }
 __initcall(mtrr_init_finialize);
diff --git a/xen/arch/x86/cpu/mtrr/mtrr.h b/xen/arch/x86/cpu/mtrr/mtrr.h
index 92b0b11..5e0d832 100644
--- a/xen/arch/x86/cpu/mtrr/mtrr.h
+++ b/xen/arch/x86/cpu/mtrr/mtrr.h
@@ -64,7 +64,6 @@  extern u64 size_or_mask, size_and_mask;
 extern const struct mtrr_ops *mtrr_if;
 
 #define is_cpu(vnd)	(X86_VENDOR_INTEL == X86_VENDOR_##vnd)
-#define use_intel()	(1)
 
 extern unsigned int num_var_ranges;