Skip to contentSkip to conversation

x86/cpu: Consolidate identical branches

PATCH In review Nikolay Borisov 1 participant 2 messages May 21, 2024 – Jun 10, 2024 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/cpu: Consolidate identical branches

It's pointless to have 2 identical branches one after the other, simply collapse them in a single branch. No functional changes.

---
 arch/x86/kernel/cpu/common.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/common.c +3 -4
index 69265c0acaea..369037a166fd 100644
@@ -1732,12 +1732,11 @@ static void generic_identify(struct cpuinfo_x86 *c)
 {
 	c->extended_cpuid_level = 0;
 
-	if (!have_cpuid_p())
+	if (!have_cpuid_p()) {
 		identify_cpu_without_cpuid(c);
-
-	/* cyrix could have cpuid enabled via c_identify()*/
-	if (!have_cpuid_p())
+		/* cyrix could have cpuid enabled via c_identify()*/
 		return;
+	}
 
 	cpu_detect(c);
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 4 lines · Nikolay Borisov

It's pointless to have 2 identical branches one after the other, simply collapse them in a single branch. No functional changes.

Ping

Quoted 24 lines
---
  arch/x86/kernel/cpu/common.c | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/common.c +3 -4
index 69265c0acaea..369037a166fd 100644
@@ -1732,12 +1732,11 @@ static void generic_identify(struct cpuinfo_x86 *c)
  {
  	c->extended_cpuid_level = 0;
 
-	if (!have_cpuid_p())
+	if (!have_cpuid_p()) {
  		identify_cpu_without_cpuid(c);
-
-	/* cyrix could have cpuid enabled via c_identify()*/
-	if (!have_cpuid_p())
+		/* cyrix could have cpuid enabled via c_identify()*/
  		return;
+	}
 
  	cpu_detect(c);