[PATCH] x86/cpu: Consolidate identical branches

Nikolay Borisov posted 1 patch 1 year, 8 months ago
arch/x86/kernel/cpu/common.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[PATCH] x86/cpu: Consolidate identical branches
Posted by Nikolay Borisov 1 year, 8 months ago
It's pointless to have 2 identical branches one after the other, simply
collapse them in a single branch. No functional changes.

Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
---
 arch/x86/kernel/cpu/common.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 69265c0acaea..369037a166fd 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -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);
 
-- 
2.34.1
Re: [PATCH] x86/cpu: Consolidate identical branches
Posted by Nikolay Borisov 1 year, 8 months ago

On 21.05.24 г. 15:48 ч., Nikolay Borisov wrote:
> It's pointless to have 2 identical branches one after the other, simply
> collapse them in a single branch. No functional changes.
> 
> Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>

Ping

> ---
>   arch/x86/kernel/cpu/common.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 69265c0acaea..369037a166fd 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -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);
>