[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1217277694.20627.9.camel@earth>
Date: Mon, 28 Jul 2008 22:41:34 +0200
From: Dmitry Adamushko <dmitry.adamushko@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Ingo Molnar <mingo@...e.hu>, Oleg Nesterov <oleg@...sign.ru>
Subject: [patch, minor] workqueue: consistently use 'err' in
__create_workqueue_key()
I guess error handling is a bit illogical in __create_workqueue_key().
Although, it won't cause any real problems.
---
From: Dmitry Adamushko <dmitry.adamushko@...il.com>
Subject: workqueue: consistently use 'err' in __create_workqueue_key()
Fix the logic behind the use of 'err' in the 'for_each_posible_cpu()' loop
of __create_workqueue_key().
Signed-off-by: Dmitry Adamushko <dmitry.adamushko@...il.com>
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ec7e4f6..738bf05 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -827,7 +827,8 @@ struct workqueue_struct *__create_workqueue_key(const char *name,
if (singlethread) {
cwq = init_cpu_workqueue(wq, singlethread_cpu);
err = create_workqueue_thread(cwq, singlethread_cpu);
- start_workqueue_thread(cwq, -1);
+ if (!err)
+ start_workqueue_thread(cwq, -1);
} else {
cpu_maps_update_begin();
spin_lock(&workqueue_lock);
@@ -836,9 +837,11 @@ struct workqueue_struct *__create_workqueue_key(const char *name,
for_each_possible_cpu(cpu) {
cwq = init_cpu_workqueue(wq, cpu);
- if (err || !cpu_online(cpu))
+ if (!cpu_online(cpu))
continue;
err = create_workqueue_thread(cwq, cpu);
+ if (err)
+ break;
start_workqueue_thread(cwq, cpu);
}
cpu_maps_update_done();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists