]> git.karo-electronics.de Git - karo-tx-linux.git/commit
workqueue: make alloc_workqueue() take printf fmt and args for name
authorTejun Heo <tj@kernel.org>
Thu, 8 Dec 2011 04:42:51 +0000 (15:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Dec 2011 06:43:35 +0000 (17:43 +1100)
commit978ef061a86b229e2a75fd61ec0fb4e3d999b62a
tree038694f572a03cc6d65d335237fc71bfc90faff0
parent38d11ac963975936631fec8f5430eb4ee964a0e2
workqueue: make alloc_workqueue() take printf fmt and args for name

alloc_workqueue() currently expects the passed in @name pointer to remain
accessible.  This is inconvenient and a bit silly given that the whole wq
is being dynamically allocated.  This patch updates alloc_workqueue() and
friends to take printf format string instead of opaque string and matching
varargs at the end.  The name is allocated together with the wq and
formatted.

alloc_ordered_workqueue() is converted to a macro to unify varargs
handling with alloc_workqueue(), and, while at it, add comment to
alloc_workqueue().

None of the current in-kernel users pass in string with '%' as constant
name and this change shouldn't cause any problem.

Signed-off-by: Tejun Heo <tj@kernel.org>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/workqueue.h
kernel/workqueue.c