linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] workqueue: move function definitions within CONFIG_SMP block
@ 2018-05-22 19:47 Mathieu Malaterre
  2018-05-23 18:17 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Malaterre @ 2018-05-22 19:47 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Mathieu Malaterre, Lai Jiangshan, linux-kernel

In commit 7ee681b25284 ("workqueue: Convert to state machine callbacks"),
three new function definitions were added: ‘workqueue_prepare_cpu’,
‘workqueue_online_cpu’ and ‘workqueue_offline_cpu’.

Move these function definitions within a CONFIG_SMP block since they are
not used outside of it. This will match function declarations in header
<include/linux/workqueue.h>, and silence the following gcc warning (W=1):

  kernel/workqueue.c:4743:5: warning: no previous prototype for ‘workqueue_prepare_cpu’ [-Wmissing-prototypes]
  kernel/workqueue.c:4756:5: warning: no previous prototype for ‘workqueue_online_cpu’ [-Wmissing-prototypes]
  kernel/workqueue.c:4783:5: warning: no previous prototype for ‘workqueue_offline_cpu’ [-Wmissing-prototypes]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 kernel/workqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ca7959be8aaa..c1544225c696 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4579,6 +4579,8 @@ void show_workqueue_state(void)
 	rcu_read_unlock_sched();
 }
 
+#ifdef CONFIG_SMP
+
 /*
  * CPU hotplug.
  *
@@ -4799,8 +4801,6 @@ int workqueue_offline_cpu(unsigned int cpu)
 	return 0;
 }
 
-#ifdef CONFIG_SMP
-
 struct work_for_cpu {
 	struct work_struct work;
 	long (*fn)(void *);
-- 
2.11.0

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

* Re: [PATCH] workqueue: move function definitions within CONFIG_SMP block
  2018-05-22 19:47 [PATCH] workqueue: move function definitions within CONFIG_SMP block Mathieu Malaterre
@ 2018-05-23 18:17 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2018-05-23 18:17 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: Lai Jiangshan, linux-kernel

On Tue, May 22, 2018 at 09:47:32PM +0200, Mathieu Malaterre wrote:
> In commit 7ee681b25284 ("workqueue: Convert to state machine callbacks"),
> three new function definitions were added: ‘workqueue_prepare_cpu’,
> ‘workqueue_online_cpu’ and ‘workqueue_offline_cpu’.
> 
> Move these function definitions within a CONFIG_SMP block since they are
> not used outside of it. This will match function declarations in header
> <include/linux/workqueue.h>, and silence the following gcc warning (W=1):
> 
>   kernel/workqueue.c:4743:5: warning: no previous prototype for ‘workqueue_prepare_cpu’ [-Wmissing-prototypes]
>   kernel/workqueue.c:4756:5: warning: no previous prototype for ‘workqueue_online_cpu’ [-Wmissing-prototypes]
>   kernel/workqueue.c:4783:5: warning: no previous prototype for ‘workqueue_offline_cpu’ [-Wmissing-prototypes]
> 
> Signed-off-by: Mathieu Malaterre <malat@debian.org>

Applied to wq/for-4.18.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2018-05-23 18:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 19:47 [PATCH] workqueue: move function definitions within CONFIG_SMP block Mathieu Malaterre
2018-05-23 18:17 ` Tejun Heo

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).