Commit 9d9edb96 authored by YueHaibing's avatar YueHaibing Committed by Marc Zyngier

arm64: Fix -Wunused-function warning when !CONFIG_HOTPLUG_CPU

If CONFIG_HOTPLUG_CPU is n, gcc warns:

arch/arm64/kernel/smp.c:967:13: warning: ‘ipi_teardown’ defined but not used [-Wunused-function]
 static void ipi_teardown(int cpu)
             ^~~~~~~~~~~~

Use #ifdef guard this.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200918123318.23764-1-yuehaibing@huawei.com
parent 8594c3b8
...@@ -82,9 +82,9 @@ static int nr_ipi __read_mostly = NR_IPI; ...@@ -82,9 +82,9 @@ static int nr_ipi __read_mostly = NR_IPI;
static struct irq_desc *ipi_desc[NR_IPI] __read_mostly; static struct irq_desc *ipi_desc[NR_IPI] __read_mostly;
static void ipi_setup(int cpu); static void ipi_setup(int cpu);
static void ipi_teardown(int cpu);
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
static void ipi_teardown(int cpu);
static int op_cpu_kill(unsigned int cpu); static int op_cpu_kill(unsigned int cpu);
#else #else
static inline int op_cpu_kill(unsigned int cpu) static inline int op_cpu_kill(unsigned int cpu)
...@@ -964,6 +964,7 @@ static void ipi_setup(int cpu) ...@@ -964,6 +964,7 @@ static void ipi_setup(int cpu)
enable_percpu_irq(ipi_irq_base + i, 0); enable_percpu_irq(ipi_irq_base + i, 0);
} }
#ifdef CONFIG_HOTPLUG_CPU
static void ipi_teardown(int cpu) static void ipi_teardown(int cpu)
{ {
int i; int i;
...@@ -974,6 +975,7 @@ static void ipi_teardown(int cpu) ...@@ -974,6 +975,7 @@ static void ipi_teardown(int cpu)
for (i = 0; i < nr_ipi; i++) for (i = 0; i < nr_ipi; i++)
disable_percpu_irq(ipi_irq_base + i); disable_percpu_irq(ipi_irq_base + i);
} }
#endif
void __init set_smp_ipi_range(int ipi_base, int n) void __init set_smp_ipi_range(int ipi_base, int n)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment