diff options
| author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2013-03-12 16:59:14 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2013-03-12 16:59:14 -0400 |
| commit | 362f2b098b188ede9c4350cc20e58040dbfa515e (patch) | |
| tree | 17ff75cb57d281e46facf7704ae49d76dc29a3b7 | |
| parent | cc2a8b1a5595a435191fb197d92d1f3e193c9a6d (diff) | |
async: rename and redefine async_func_ptr
A function type is typically defined as
typedef ret_type (*func)(args..)
but async_func_ptr is not. Redefine it.
Also rename async_func_ptr to async_func_t for _func_t suffix is more generic.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
| -rw-r--r-- | arch/sh/drivers/pci/pcie-sh7786.c | 2 | ||||
| -rw-r--r-- | include/linux/async.h | 6 | ||||
| -rw-r--r-- | kernel/async.c | 20 |
3 files changed, 14 insertions, 14 deletions
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c index c2c85f6cd738..a162a7f86b2e 100644 --- a/arch/sh/drivers/pci/pcie-sh7786.c +++ b/arch/sh/drivers/pci/pcie-sh7786.c | |||
| @@ -35,7 +35,7 @@ static unsigned int nr_ports; | |||
| 35 | 35 | ||
| 36 | static struct sh7786_pcie_hwops { | 36 | static struct sh7786_pcie_hwops { |
| 37 | int (*core_init)(void); | 37 | int (*core_init)(void); |
| 38 | async_func_ptr *port_init_hw; | 38 | async_func_t port_init_hw; |
| 39 | } *sh7786_pcie_hwops; | 39 | } *sh7786_pcie_hwops; |
| 40 | 40 | ||
| 41 | static struct resource sh7786_pci0_resources[] = { | 41 | static struct resource sh7786_pci0_resources[] = { |
diff --git a/include/linux/async.h b/include/linux/async.h index 98ea0fef30d5..6b0226bdaadc 100644 --- a/include/linux/async.h +++ b/include/linux/async.h | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #include <linux/list.h> | 16 | #include <linux/list.h> |
| 17 | 17 | ||
| 18 | typedef u64 async_cookie_t; | 18 | typedef u64 async_cookie_t; |
| 19 | typedef void (async_func_ptr) (void *data, async_cookie_t cookie); | 19 | typedef void (*async_func_t) (void *data, async_cookie_t cookie); |
| 20 | struct async_domain { | 20 | struct async_domain { |
| 21 | struct list_head pending; | 21 | struct list_head pending; |
| 22 | unsigned registered:1; | 22 | unsigned registered:1; |
| @@ -37,8 +37,8 @@ struct async_domain { | |||
| 37 | struct async_domain _name = { .pending = LIST_HEAD_INIT(_name.pending), \ | 37 | struct async_domain _name = { .pending = LIST_HEAD_INIT(_name.pending), \ |
| 38 | .registered = 0 } | 38 | .registered = 0 } |
| 39 | 39 | ||
| 40 | extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data); | 40 | extern async_cookie_t async_schedule(async_func_t func, void *data); |
| 41 | extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data, | 41 | extern async_cookie_t async_schedule_domain(async_func_t func, void *data, |
| 42 | struct async_domain *domain); | 42 | struct async_domain *domain); |
| 43 | void async_unregister_domain(struct async_domain *domain); | 43 | void async_unregister_domain(struct async_domain *domain); |
| 44 | extern void async_synchronize_full(void); | 44 | extern void async_synchronize_full(void); |
diff --git a/kernel/async.c b/kernel/async.c index ab99c92f6b68..61f023ce0228 100644 --- a/kernel/async.c +++ b/kernel/async.c | |||
| @@ -73,7 +73,7 @@ struct async_entry { | |||
| 73 | struct list_head global_list; | 73 | struct list_head global_list; |
| 74 | struct work_struct work; | 74 | struct work_struct work; |
| 75 | async_cookie_t cookie; | 75 | async_cookie_t cookie; |
| 76 | async_func_ptr *func; | 76 | async_func_t func; |
| 77 | void *data; | 77 | void *data; |
| 78 | struct async_domain *domain; | 78 | struct async_domain *domain; |
| 79 | }; | 79 | }; |
| @@ -145,7 +145,7 @@ static void async_run_entry_fn(struct work_struct *work) | |||
| 145 | wake_up(&async_done); | 145 | wake_up(&async_done); |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct async_domain *domain) | 148 | static async_cookie_t __async_schedule(async_func_t func, void *data, struct async_domain *domain) |
| 149 | { | 149 | { |
| 150 | struct async_entry *entry; | 150 | struct async_entry *entry; |
| 151 | unsigned long flags; | 151 | unsigned long flags; |
| @@ -165,13 +165,13 @@ static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct a | |||
| 165 | spin_unlock_irqrestore(&async_lock, flags); | 165 | spin_unlock_irqrestore(&async_lock, flags); |
| 166 | 166 | ||
| 167 | /* low on memory.. run synchronously */ | 167 | /* low on memory.. run synchronously */ |
| 168 | ptr(data, newcookie); | 168 | func(data, newcookie); |
| 169 | return newcookie; | 169 | return newcookie; |
| 170 | } | 170 | } |
| 171 | INIT_LIST_HEAD(&entry->domain_list); | 171 | INIT_LIST_HEAD(&entry->domain_list); |
| 172 | INIT_LIST_HEAD(&entry->global_list); | 172 | INIT_LIST_HEAD(&entry->global_list); |
| 173 | INIT_WORK(&entry->work, async_run_entry_fn); | 173 | INIT_WORK(&entry->work, async_run_entry_fn); |
| 174 | entry->func = ptr; | 174 | entry->func = func; |
| 175 | entry->data = data; | 175 | entry->data = data; |
| 176 | entry->domain = domain; | 176 | entry->domain = domain; |
| 177 | 177 | ||
| @@ -198,21 +198,21 @@ static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct a | |||
| 198 | 198 | ||
| 199 | /** | 199 | /** |
| 200 | * async_schedule - schedule a function for asynchronous execution | 200 | * async_schedule - schedule a function for asynchronous execution |
| 201 | * @ptr: function to execute asynchronously | 201 | * @func: function to execute asynchronously |
| 202 | * @data: data pointer to pass to the function | 202 | * @data: data pointer to pass to the function |
| 203 | * | 203 | * |
| 204 | * Returns an async_cookie_t that may be used for checkpointing later. | 204 | * Returns an async_cookie_t that may be used for checkpointing later. |
| 205 | * Note: This function may be called from atomic or non-atomic contexts. | 205 | * Note: This function may be called from atomic or non-atomic contexts. |
| 206 | */ | 206 | */ |
| 207 | async_cookie_t async_schedule(async_func_ptr *ptr, void *data) | 207 | async_cookie_t async_schedule(async_func_t func, void *data) |
| 208 | { | 208 | { |
| 209 | return __async_schedule(ptr, data, &async_dfl_domain); | 209 | return __async_schedule(func, data, &async_dfl_domain); |
| 210 | } | 210 | } |
| 211 | EXPORT_SYMBOL_GPL(async_schedule); | 211 | EXPORT_SYMBOL_GPL(async_schedule); |
| 212 | 212 | ||
| 213 | /** | 213 | /** |
| 214 | * async_schedule_domain - schedule a function for asynchronous execution within a certain domain | 214 | * async_schedule_domain - schedule a function for asynchronous execution within a certain domain |
| 215 | * @ptr: function to execute asynchronously | 215 | * @func: function to execute asynchronously |
| 216 | * @data: data pointer to pass to the function | 216 | * @data: data pointer to pass to the function |
| 217 | * @domain: the domain | 217 | * @domain: the domain |
| 218 | * | 218 | * |
| @@ -222,10 +222,10 @@ EXPORT_SYMBOL_GPL(async_schedule); | |||
| 222 | * synchronization domain is specified via @domain. Note: This function | 222 | * synchronization domain is specified via @domain. Note: This function |
| 223 | * may be called from atomic or non-atomic contexts. | 223 | * may be called from atomic or non-atomic contexts. |
| 224 | */ | 224 | */ |
| 225 | async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data, | 225 | async_cookie_t async_schedule_domain(async_func_t func, void *data, |
| 226 | struct async_domain *domain) | 226 | struct async_domain *domain) |
| 227 | { | 227 | { |
| 228 | return __async_schedule(ptr, data, domain); | 228 | return __async_schedule(func, data, domain); |
| 229 | } | 229 | } |
| 230 | EXPORT_SYMBOL_GPL(async_schedule_domain); | 230 | EXPORT_SYMBOL_GPL(async_schedule_domain); |
| 231 | 231 | ||
