Skip to content

Commit

Permalink
workqueue: move function definitions within CONFIG_SMP block
Browse files Browse the repository at this point in the history
In commit 7ee681b ("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>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Mathieu Malaterre authored and Tejun Heo committed May 23, 2018
1 parent 197f6ac commit 66448bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -4626,6 +4626,8 @@ void wq_worker_comm(char *buf, size_t size, struct task_struct *task)
mutex_unlock(&wq_pool_attach_mutex);
}

#ifdef CONFIG_SMP

/*
* CPU hotplug.
*
Expand Down Expand Up @@ -4846,8 +4848,6 @@ int workqueue_offline_cpu(unsigned int cpu)
return 0;
}

#ifdef CONFIG_SMP

struct work_for_cpu {
struct work_struct work;
long (*fn)(void *);
Expand Down

0 comments on commit 66448bc

Please sign in to comment.