diff mbox

[1/3] async: Add async_domain_init_exclusive() helper

Message ID 1412758013-23608-1-git-send-email-j.anaszewski@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jacek Anaszewski Oct. 8, 2014, 8:46 a.m. UTC
From: Sylwester Nawrocki <s.nawrocki@samsung.com>

Add a helper to allow initialization of struct async_domain at runtime.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 include/linux/async.h |    6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/include/linux/async.h b/include/linux/async.h
index 6b0226b..807e40b 100644
--- a/include/linux/async.h
+++ b/include/linux/async.h
@@ -37,6 +37,12 @@  struct async_domain {
 	struct async_domain _name = { .pending = LIST_HEAD_INIT(_name.pending), \
 				      .registered = 0 }
 
+static inline void async_domain_init_exclusive(struct async_domain *domain)
+{
+	INIT_LIST_HEAD(&domain->pending);
+	domain->registered = 0;
+}
+
 extern async_cookie_t async_schedule(async_func_t func, void *data);
 extern async_cookie_t async_schedule_domain(async_func_t func, void *data,
 					    struct async_domain *domain);