diff mbox

[2,3/4] powerpc: drop smp_generic_cpu_bootable()

Message ID 20141205151455.11028.573.stgit@bahia.lab.toulouse-stg.fr.ibm.com (mailing list archive)
State Changes Requested
Delegated to: Michael Ellerman
Headers show

Commit Message

Greg Kurz Dec. 5, 2014, 3:15 p.m. UTC
The following assertions are always true:
- threads_per_core > 0
- cpu & (threads_per_core - 1) < threads_per_core

It means smp_generic_cpu_bootable() always returns true.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/smp.c |   11 -----------
 1 file changed, 11 deletions(-)

Comments

Greg Kurz Dec. 5, 2014, 3:34 p.m. UTC | #1
Subject should read "powerpc: drop useless code in smp_generic_cpu_bootable()"
actually...

On Fri, 05 Dec 2014 16:15:12 +0100
Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> The following assertions are always true:
> - threads_per_core > 0
> - cpu & (threads_per_core - 1) < threads_per_core
> 
> It means smp_generic_cpu_bootable() always returns true.
> 
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> ---
>  arch/powerpc/kernel/smp.c |   11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 9577791..8d7f114 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -89,17 +89,6 @@ static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
>   */
>  int smp_generic_cpu_bootable(unsigned int nr)
>  {
> -	/* Special case - we inhibit secondary thread startup
> -	 * during boot if the user requests it.
> -	 */
> -	if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
> -		if (!threads_per_core && cpu_thread_in_core(nr) != 0)
> -			return 0;
> -		if (threads_per_core
> -		    && cpu_thread_in_core(nr) >= threads_per_core)
> -			return 0;
> -	}
> -
>  	return 1;
>  }
>  
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
diff mbox

Patch

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 9577791..8d7f114 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -89,17 +89,6 @@  static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
  */
 int smp_generic_cpu_bootable(unsigned int nr)
 {
-	/* Special case - we inhibit secondary thread startup
-	 * during boot if the user requests it.
-	 */
-	if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
-		if (!threads_per_core && cpu_thread_in_core(nr) != 0)
-			return 0;
-		if (threads_per_core
-		    && cpu_thread_in_core(nr) >= threads_per_core)
-			return 0;
-	}
-
 	return 1;
 }