diff options
Diffstat (limited to 'include/linux/completion.h')
-rw-r--r-- | include/linux/completion.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/completion.h b/include/linux/completion.h index 251c41e3ddd5..268c5a4a2bd4 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -18,6 +18,9 @@ struct completion { | |||
18 | #define COMPLETION_INITIALIZER(work) \ | 18 | #define COMPLETION_INITIALIZER(work) \ |
19 | { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } | 19 | { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } |
20 | 20 | ||
21 | #define COMPLETION_INITIALIZER_ONSTACK(work) \ | ||
22 | ({ init_completion(&work); work; }) | ||
23 | |||
21 | #define DECLARE_COMPLETION(work) \ | 24 | #define DECLARE_COMPLETION(work) \ |
22 | struct completion work = COMPLETION_INITIALIZER(work) | 25 | struct completion work = COMPLETION_INITIALIZER(work) |
23 | 26 | ||
@@ -28,7 +31,7 @@ struct completion { | |||
28 | */ | 31 | */ |
29 | #ifdef CONFIG_LOCKDEP | 32 | #ifdef CONFIG_LOCKDEP |
30 | # define DECLARE_COMPLETION_ONSTACK(work) \ | 33 | # define DECLARE_COMPLETION_ONSTACK(work) \ |
31 | struct completion work = ({ init_completion(&work); work; }) | 34 | struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) |
32 | #else | 35 | #else |
33 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) | 36 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) |
34 | #endif | 37 | #endif |