x86, cpu, amd: Fix a shadowed variable situation
authorBorislav Petkov <bp@suse.de>
Wed, 15 Jan 2014 11:52:15 +0000 (12:52 +0100)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 15 Jan 2014 12:21:45 +0000 (04:21 -0800)
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>
arch/x86/kernel/cpu/amd.c

index 39bc78dad377aaa325852c02f4bdd68440a17696..e5647ab5fc23b2b859775929c595c30c7e8595bb 100644 (file)
@@ -789,14 +789,10 @@ static void cpu_detect_tlb_amd(struct cpuinfo_x86 *c)
        }
 
        /* Handle DTLB 2M and 4M sizes, fall back to L1 if L2 is disabled */
-       if (!((eax >> 16) & mask)) {
-               u32 a, b, c, d;
-
-               cpuid(0x80000005, &a, &b, &c, &d);
-               tlb_lld_2m[ENTRIES] = (a >> 16) & 0xff;
-       } else {
+       if (!((eax >> 16) & mask))
+               tlb_lld_2m[ENTRIES] = (cpuid_eax(0x80000005) >> 16) & 0xff;
+       else
                tlb_lld_2m[ENTRIES] = (eax >> 16) & mask;
-       }
 
        /* a 4M entry uses two 2M entries */
        tlb_lld_4m[ENTRIES] = tlb_lld_2m[ENTRIES] >> 1;
This page took 0.024752 seconds and 5 git commands to generate.