aboutsummaryrefslogtreecommitdiff
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
authorMatthew Brost <matthew.brost@intel.com>2024-08-20 12:38:08 -0700
committerTejun Heo <tj@kernel.org>2024-08-20 09:38:39 -1000
commit9b59a85a84dc37ca4f2c54df5e06aff4c1eae5d3 (patch)
tree9496451c0f49e63b8fdb2e41fad0adab9368be48 /include/linux/workqueue.h
parent8dffaec34dd55473adcbc924a4c9b04aaa0d4278 (diff)
workqueue: Don't call va_start / va_end twice
Calling va_start / va_end multiple times is undefined and causes problems with certain compiler / platforms. Change alloc_ordered_workqueue_lockdep_map to a macro and updated __alloc_workqueue to take a va_list argument. Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Cc: Tejun Heo <tj@kernel.org> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r--include/linux/workqueue.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 04dff07a9e2b..f3cc15940b4d 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -543,20 +543,8 @@ alloc_workqueue_lockdep_map(const char *fmt, unsigned int flags, int max_active,
* RETURNS:
* Pointer to the allocated workqueue on success, %NULL on failure.
*/
-__printf(1, 4) static inline struct workqueue_struct *
-alloc_ordered_workqueue_lockdep_map(const char *fmt, unsigned int flags,
- struct lockdep_map *lockdep_map, ...)
-{
- struct workqueue_struct *wq;
- va_list args;
-
- va_start(args, lockdep_map);
- wq = alloc_workqueue_lockdep_map(fmt, WQ_UNBOUND | __WQ_ORDERED | flags,
- 1, lockdep_map, args);
- va_end(args);
-
- return wq;
-}
+#define alloc_ordered_workqueue_lockdep_map(fmt, flags, lockdep_map, args...) \
+ alloc_workqueue_lockdep_map(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, lockdep_map, ##args)
#endif
/**