summaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorLai Jiangshan <jiangshan.ljs@antgroup.com>2024-07-02 06:14:56 +0200
committerTejun Heo <tj@kernel.org>2024-07-02 19:17:22 +0200
commitb3d209164dc0aca115057b00d6b466793a747c87 (patch)
tree8353c6e7a66f377367d0bc7dba79ef8ca408ff84 /kernel/workqueue.c
parentworkqueue: Update cpumasks after only applying it successfully (diff)
downloadlinux-b3d209164dc0aca115057b00d6b466793a747c87.tar.xz
linux-b3d209164dc0aca115057b00d6b466793a747c87.zip
workqueue: Simplify goto statement
Use a simple if-statement to replace the cumbersome goto-statement in workqueue_set_unbound_cpumask(). Cc: Waiman Long <longman@redhat.com> Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 6adee950077a..32ac6f1e94a8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -7197,15 +7197,10 @@ static int workqueue_set_unbound_cpumask(cpumask_var_t cpumask)
*/
cpumask_and(cpumask, cpumask, cpu_possible_mask);
if (!cpumask_empty(cpumask)) {
+ ret = 0;
apply_wqattrs_lock();
- if (cpumask_equal(cpumask, wq_unbound_cpumask)) {
- ret = 0;
- goto out_unlock;
- }
-
- ret = workqueue_apply_unbound_cpumask(cpumask);
-
-out_unlock:
+ if (!cpumask_equal(cpumask, wq_unbound_cpumask))
+ ret = workqueue_apply_unbound_cpumask(cpumask);
if (!ret)
cpumask_copy(wq_requested_unbound_cpumask, cpumask);
apply_wqattrs_unlock();