Skip to content

Commit 95bfb35

Browse files
bp3tk0vIngo Molnar
authored and
Ingo Molnar
committed
x86/cpu: Get rid of an unnecessary local variable in get_cpu_address_sizes()
Drop 'vp_bits_from_cpuid' as it is not really needed. No functional changes. Signed-off-by: Borislav Petkov (AMD) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent edf66a3 commit 95bfb35

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

arch/x86/kernel/cpu/common.c

+7-10
Original file line numberDiff line numberDiff line change
@@ -1053,18 +1053,9 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
10531053
void get_cpu_address_sizes(struct cpuinfo_x86 *c)
10541054
{
10551055
u32 eax, ebx, ecx, edx;
1056-
bool vp_bits_from_cpuid = true;
10571056

10581057
if (!cpu_has(c, X86_FEATURE_CPUID) ||
1059-
(c->extended_cpuid_level < 0x80000008))
1060-
vp_bits_from_cpuid = false;
1061-
1062-
if (vp_bits_from_cpuid) {
1063-
cpuid(0x80000008, &eax, &ebx, &ecx, &edx);
1064-
1065-
c->x86_virt_bits = (eax >> 8) & 0xff;
1066-
c->x86_phys_bits = eax & 0xff;
1067-
} else {
1058+
(c->extended_cpuid_level < 0x80000008)) {
10681059
if (IS_ENABLED(CONFIG_X86_64)) {
10691060
c->x86_clflush_size = 64;
10701061
c->x86_phys_bits = 36;
@@ -1078,7 +1069,13 @@ void get_cpu_address_sizes(struct cpuinfo_x86 *c)
10781069
cpu_has(c, X86_FEATURE_PSE36))
10791070
c->x86_phys_bits = 36;
10801071
}
1072+
} else {
1073+
cpuid(0x80000008, &eax, &ebx, &ecx, &edx);
1074+
1075+
c->x86_virt_bits = (eax >> 8) & 0xff;
1076+
c->x86_phys_bits = eax & 0xff;
10811077
}
1078+
10821079
c->x86_cache_bits = c->x86_phys_bits;
10831080
c->x86_cache_alignment = c->x86_clflush_size;
10841081
}

0 commit comments

Comments
 (0)