linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm/smp: Make boot_secondary() static
@ 2014-01-03 15:45 Geert Uytterhoeven
  2014-01-03 17:04 ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-01-03 15:45 UTC (permalink / raw)
  To: linux-arm-kernel

From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

After becoming a mandatory function, boot_secondary() is no longer used
outside arch/arm/kernel/smp.c. Hence make it static.
The code is reshuffled a bit to avoid a forward declaration.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 arch/arm/include/asm/smp.h |    6 ------
 arch/arm/kernel/smp.c      |   18 +++++++++++-------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 22a3b9b5d4a1..0d2c8c6f8d1d 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -49,12 +49,6 @@ extern void smp_init_cpus(void);
 extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
 
 /*
- * Boot a secondary CPU, and assign it the specified idle task.
- * This also gives us the initial stack to use for this CPU.
- */
-extern int boot_secondary(unsigned int cpu, struct task_struct *);
-
-/*
  * Called from platform specific assembly code, this is the
  * secondary CPU entry point.
  */
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index dc894ab3622b..d05259a33d93 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -88,6 +88,17 @@ static unsigned long get_arch_pgd(pgd_t *pgd)
 	return pgdir >> ARCH_PGD_SHIFT;
 }
 
+/*
+ * Boot a secondary CPU, and assign it the specified idle task.
+ * This also gives us the initial stack to use for this CPU.
+ */
+static int boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	if (smp_ops.smp_boot_secondary)
+		return smp_ops.smp_boot_secondary(cpu, idle);
+	return -ENOSYS;
+}
+
 int __cpu_up(unsigned int cpu, struct task_struct *idle)
 {
 	int ret;
@@ -140,13 +151,6 @@ void __init smp_init_cpus(void)
 		smp_ops.smp_init_cpus();
 }
 
-int boot_secondary(unsigned int cpu, struct task_struct *idle)
-{
-	if (smp_ops.smp_boot_secondary)
-		return smp_ops.smp_boot_secondary(cpu, idle);
-	return -ENOSYS;
-}
-
 int platform_can_cpu_hotplug(void)
 {
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] arm/smp: Make boot_secondary() static
  2014-01-03 15:45 [PATCH] arm/smp: Make boot_secondary() static Geert Uytterhoeven
@ 2014-01-03 17:04 ` Arnd Bergmann
  2014-01-03 18:24   ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2014-01-03 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 03 January 2014, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> 
> After becoming a mandatory function, boot_secondary() is no longer used
> outside arch/arm/kernel/smp.c. Hence make it static.
> The code is reshuffled a bit to avoid a forward declaration.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

How about taking it one step further by removing the function entirely?
Like this:

@@ -92,6 +92,9 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
 {
 	int ret;
 
+	if (!smp_ops.smp_boot_secondary)
+		return -ENOSYS;
+
 	/*
 	 * We need to tell the secondary core where to find
 	 * its stack and the page tables.
@@ -111,7 +114,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
 	/*
 	 * Now bring the CPU into our world.
 	 */
-	ret = boot_secondary(cpu, idle);
+	ret = smp_ops.smp_boot_secondary(cpu, idle);
 	if (ret == 0) {
 		/*
 		 * CPU was successfully started, wait for it


I guess we could do the same for some of the other operations as well
if everyone likes the approach.

	Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm/smp: Make boot_secondary() static
  2014-01-03 17:04 ` Arnd Bergmann
@ 2014-01-03 18:24   ` Geert Uytterhoeven
  2014-01-03 18:41     ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-01-03 18:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 3, 2014 at 6:04 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 03 January 2014, Geert Uytterhoeven wrote:
>> From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
>>
>> After becoming a mandatory function, boot_secondary() is no longer used
>> outside arch/arm/kernel/smp.c. Hence make it static.
>> The code is reshuffled a bit to avoid a forward declaration.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
>
> How about taking it one step further by removing the function entirely?
> Like this:
>
> @@ -92,6 +92,9 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
>  {
>         int ret;
>
> +       if (!smp_ops.smp_boot_secondary)
> +               return -ENOSYS;
> +
>         /*
>          * We need to tell the secondary core where to find
>          * its stack and the page tables.
> @@ -111,7 +114,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
>         /*
>          * Now bring the CPU into our world.
>          */
> -       ret = boot_secondary(cpu, idle);
> +       ret = smp_ops.smp_boot_secondary(cpu, idle);
>         if (ret == 0) {
>                 /*
>                  * CPU was successfully started, wait for it

Fine for me.

Do you want me to fold this into my patch, or will you apply this on top?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm/smp: Make boot_secondary() static
  2014-01-03 18:24   ` Geert Uytterhoeven
@ 2014-01-03 18:41     ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2014-01-03 18:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 03 January 2014 19:24:19 Geert Uytterhoeven wrote:
> Fine for me.
> 
> Do you want me to fold this into my patch, or will you apply this on top?
> 
> 

The patch is for Russell anyway, so please fold my change into your
patch, unless he prefers your previous version of course.

	Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-03 18:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-03 15:45 [PATCH] arm/smp: Make boot_secondary() static Geert Uytterhoeven
2014-01-03 17:04 ` Arnd Bergmann
2014-01-03 18:24   ` Geert Uytterhoeven
2014-01-03 18:41     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).