2018-03-16 06:40:28

by Dou Liyang

[permalink] [raw]
Subject: [PATCH] kernel/cpu: Move cpuhp_is_atomic_state() into #ifdef CONFIG_SMP

Commit 17a2f1ced028 ("cpu/hotplug: Merge cpuhp_bp_states and cpuhp_ap_states")
removed the last use of cpuhp_is_atomic_state() in common case, that caused
Kernel produced a warning:

'cpuhp_is_ap_state' defined but not used

So, Move it into #ifdef CONFIG_SMP

Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Dou Liyang <[email protected]>
---
kernel/cpu.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index a1860d42aacf..db7ec7572348 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -126,15 +126,6 @@ struct cpuhp_step {
static DEFINE_MUTEX(cpuhp_state_mutex);
static struct cpuhp_step cpuhp_hp_states[];

-static bool cpuhp_is_ap_state(enum cpuhp_state state)
-{
- /*
- * The extra check for CPUHP_TEARDOWN_CPU is only for documentation
- * purposes as that state is handled explicitly in cpu_down.
- */
- return state > CPUHP_BRINGUP_CPU && state != CPUHP_TEARDOWN_CPU;
-}
-
static struct cpuhp_step *cpuhp_get_step(enum cpuhp_state state)
{
return cpuhp_hp_states + state;
@@ -247,6 +238,15 @@ static inline void complete_ap_thread(struct cpuhp_cpu_state *st, bool bringup)
complete(done);
}

+static bool cpuhp_is_ap_state(enum cpuhp_state state)
+{
+ /*
+ * The extra check for CPUHP_TEARDOWN_CPU is only for documentation
+ * purposes as that state is handled explicitly in cpu_down.
+ */
+ return state > CPUHP_BRINGUP_CPU && state != CPUHP_TEARDOWN_CPU;
+}
+
/*
* The former STARTING/DYING states, ran with IRQs disabled and must not fail.
*/
--
2.14.3





2018-03-16 08:00:33

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH] kernel/cpu: Move cpuhp_is_atomic_state() into #ifdef CONFIG_SMP

On Fri, 16 Mar 2018, Dou Liyang wrote:

> Commit 17a2f1ced028 ("cpu/hotplug: Merge cpuhp_bp_states and cpuhp_ap_states")
> removed the last use of cpuhp_is_atomic_state() in common case, that caused
> Kernel produced a warning:
>
> 'cpuhp_is_ap_state' defined but not used
>
> So, Move it into #ifdef CONFIG_SMP

Thanks for the patch, but a fix is already queued in the smp/hotplug
branch. It just did not make it into the for-next branch yet,

Thanks,

tglx

2018-03-16 08:29:02

by Dou Liyang

[permalink] [raw]
Subject: Re: [PATCH] kernel/cpu: Move cpuhp_is_atomic_state() into #ifdef CONFIG_SMP



At 03/16/2018 03:59 PM, Thomas Gleixner wrote:
> On Fri, 16 Mar 2018, Dou Liyang wrote:
>
>> Commit 17a2f1ced028 ("cpu/hotplug: Merge cpuhp_bp_states and cpuhp_ap_states")
>> removed the last use of cpuhp_is_atomic_state() in common case, that caused
>> Kernel produced a warning:
>>
>> 'cpuhp_is_ap_state' defined but not used
>>
>> So, Move it into #ifdef CONFIG_SMP
>
> Thanks for the patch, but a fix is already queued in the smp/hotplug
> branch. It just did not make it into the for-next branch yet,
>

Oops, yes, let's ignore this patch.

Thanks,
dou

> Thanks,
>
> tglx
>
>
>