Skip to content

Commit b3d2091

Browse files
Lai Jiangshanhtejun
authored andcommitted
workqueue: Simplify goto statement
Use a simple if-statement to replace the cumbersome goto-statement in workqueue_set_unbound_cpumask(). Cc: Waiman Long <[email protected]> Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 8416588 commit b3d2091

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

kernel/workqueue.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7197,15 +7197,10 @@ static int workqueue_set_unbound_cpumask(cpumask_var_t cpumask)
71977197
*/
71987198
cpumask_and(cpumask, cpumask, cpu_possible_mask);
71997199
if (!cpumask_empty(cpumask)) {
7200+
ret = 0;
72007201
apply_wqattrs_lock();
7201-
if (cpumask_equal(cpumask, wq_unbound_cpumask)) {
7202-
ret = 0;
7203-
goto out_unlock;
7204-
}
7205-
7206-
ret = workqueue_apply_unbound_cpumask(cpumask);
7207-
7208-
out_unlock:
7202+
if (!cpumask_equal(cpumask, wq_unbound_cpumask))
7203+
ret = workqueue_apply_unbound_cpumask(cpumask);
72097204
if (!ret)
72107205
cpumask_copy(wq_requested_unbound_cpumask, cpumask);
72117206
apply_wqattrs_unlock();

0 commit comments

Comments
 (0)