Skip to contentSkip to conversation

workqueue: move function definitions within CONFIG_SMP block

PATCH Applied Mathieu Malaterre 2 participants 2 messages May 22, 2018 – May 23, 2018 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: move function definitions within CONFIG_SMP block

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]

---
 kernel/workqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/workqueue.c +2 -2
index ca7959be8aaa..c1544225c696 100644
@@ -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 *);
Signature · 1 line
2.11.0
maintainer Applied
#1 lore raw
Quoted 8 lines · Mathieu Malaterre

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

Quoted 5 lines

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]

Applied to wq/for-4.18.

Thanks.

Signature · 1 line
tejun