Skip to contentSkip to conversation

x86/AMD: re-use function wide variables in init_amd()

PATCH In review Jan Beulich 2 participants 2 messages Feb 28, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/AMD: re-use function wide variables in init_amd()

xen/arch/x86/cpu/amd.c +2 -6
@@ -399,13 +399,9 @@ static void __devinit init_amd(struct cp
 		 * revision D (model = 0x14) and later actually support it.
 		 * (AMD Erratum #110, docId: 25759).
 		 */
-		unsigned int lo, hi;
-
 		clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
-		if (!rdmsr_amd_safe(0xc001100d, &lo, &hi)) {
-			hi &= ~1;
-			wrmsr_amd_safe(0xc001100d, lo, hi);
-		}
+		if (!rdmsr_amd_safe(0xc001100d, &l, &h))
+			wrmsr_amd_safe(0xc001100d, l, h & ~1);
 	}
 
 	switch(c->x86)

x86/AMD: re-use function wide variables in init_amd()

xen/arch/x86/cpu/amd.c +2 -6
@@ -399,13 +399,9 @@ static void __devinit init_amd(struct cp
 		 * revision D (model = 0x14) and later actually support it.
 		 * (AMD Erratum #110, docId: 25759).
 		 */
-		unsigned int lo, hi;
-
 		clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
-		if (!rdmsr_amd_safe(0xc001100d, &lo, &hi)) {
-			hi &= ~1;
-			wrmsr_amd_safe(0xc001100d, lo, hi);
-		}
+		if (!rdmsr_amd_safe(0xc001100d, &l, &h))
+			wrmsr_amd_safe(0xc001100d, l, h & ~1);
 	}
 
 	switch(c->x86)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Jan Beulich
Quoted 12 lines
xen/arch/x86/cpu/amd.c +0 -2
@@ -399,13 +399,9 @@ static void __devinit init_amd(struct cp
 * revision D (model = 0x14) and later actually support it.
 * (AMD Erratum #110, docId: 25759).
 */
- unsigned int lo, hi;
-

xen/arch/x86/cpu/amd.c static void __devinit init_amd(struct cp · line 407

Quoted 10 lines
xen/arch/x86/cpu/amd.c +2 -4
 clear_bit(X86_FEATURE_LAHF_LM, c->x86_capability);
- if (!rdmsr_amd_safe(0xc001100d,&lo,&hi)) {
- hi&= ~1;
- wrmsr_amd_safe(0xc001100d, lo, hi);
- }
+ if (!rdmsr_amd_safe(0xc001100d,&l,&h))
+ wrmsr_amd_safe(0xc001100d, l, h& ~1);
 }
 
 switch(c->x86)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel