]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
workqueue: make alloc_workqueue() take printf fmt and args for name
authorTejun Heo <tj@kernel.org>
Fri, 16 Dec 2011 04:50:43 +0000 (15:50 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 20 Dec 2011 07:44:05 +0000 (18:44 +1100)
commitaeeee981378228b81dd9df1e61ca363ac0e4624b
tree946fad3e4c91e473fe92ca19bcba8e24a52fd415
parentd5b0f268bfd625f5f6df431d2c12db3b5038f50f
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