Skip to contentSkip to conversation

workqueue: remove the suspicuous out_unlock label in get_unbound_pool()

PATCH Applied Lai Jiangshan 2 participants 2 messages Jul 22, 2014 Workqueue

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 workqueue: remove the suspicuous out_unlock label in get_unbound_pool()

After the locking was moved up to the caller of the get_unbound_pool(), out_unlock label doesn't need to do any unlock operation and the name became bad, so we just remove this label, and the only usage-site "goto out_unlock" is subsituted to "return pool".

---
 kernel/workqueue.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/workqueue.c +2 -2
index b8990cf..4e9f722 100644
@@ -3462,7 +3462,7 @@ static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs)
 	hash_for_each_possible(unbound_pool_hash, pool, hash_node, hash) {
 		if (wqattrs_equal(pool->attrs, attrs)) {
 			pool->refcnt++;
-			goto out_unlock;
+			return pool;
 		}
 	}
 
@@ -3498,7 +3498,7 @@ static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs)
 
 	/* install */
 	hash_add(unbound_pool_hash, &pool->hash_node, hash);
-out_unlock:
+
 	return pool;
 fail:
 	if (pool)
Signature · 1 line
1.7.4.4
maintainer Applied
#1 lore raw
Quoted 6 lines · Lai Jiangshan

After the locking was moved up to the caller of the get_unbound_pool(), out_unlock label doesn't need to do any unlock operation and the name became bad, so we just remove this label, and the only usage-site "goto out_unlock" is subsituted to "return pool".

Applied to wq/for-3.17 w/ minor edits.

Thanks.

Signature · 1 line
tejun