]> 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>
Wed, 16 Nov 2011 23:41:46 +0000 (10:41 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Nov 2011 04:37:53 +0000 (15:37 +1100)
commit6975049ef1acb77e8ded2397540c92f888b26258
treef97f65ef58f90ddaa1d3dbc66c5ee7861b70f7fc
parente5b753bab6e8cfc5ed3bea2998937d849d5744a1
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