Skip to content

Commit d139336

Browse files
suryasaimadhuH. Peter Anvin
authored andcommitted
x86, cpu, amd: Fix a shadowed variable situation
Having u32 and struct cpuinfo_x86 * by the same name is not very smart, although it was ok in this case due to the limited scope of u32 c and it being used only once in there. Fix this. Signed-off-by: Borislav Petkov <bp@suse.de> Link: http://lkml.kernel.org/r/1389786735-16751-1-git-send-email-bp@alien8.de Signed-off-by: H. Peter Anvin <hpa@zytor.com>
1 parent 106553a commit d139336

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -789,14 +789,10 @@ static void cpu_detect_tlb_amd(struct cpuinfo_x86 *c)
789789
}
790790

791791
/* Handle DTLB 2M and 4M sizes, fall back to L1 if L2 is disabled */
792-
if (!((eax >> 16) & mask)) {
793-
u32 a, b, c, d;
794-
795-
cpuid(0x80000005, &a, &b, &c, &d);
796-
tlb_lld_2m[ENTRIES] = (a >> 16) & 0xff;
797-
} else {
792+
if (!((eax >> 16) & mask))
793+
tlb_lld_2m[ENTRIES] = (cpuid_eax(0x80000005) >> 16) & 0xff;
794+
else
798795
tlb_lld_2m[ENTRIES] = (eax >> 16) & mask;
799-
}
800796

801797
/* a 4M entry uses two 2M entries */
802798
tlb_lld_4m[ENTRIES] = tlb_lld_2m[ENTRIES] >> 1;

0 commit comments

Comments
 (0)