LKML Archive on
help / color / mirror / Atom feed
From: Mathieu Malaterre <>
To: Tejun Heo <>
Cc: Mathieu Malaterre <>,
	Lai Jiangshan <>,
Subject: [PATCH] workqueue: move function definitions within CONFIG_SMP block
Date: Tue, 22 May 2018 21:47:32 +0200	[thread overview]
Message-ID: <> (raw)

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 <>
 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)
+#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 *);

             reply	other threads:[~2018-05-22 19:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 19:47 Mathieu Malaterre [this message]
2018-05-23 18:17 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH] workqueue: move function definitions within CONFIG_SMP block' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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