History

WorkStruct: Typedef the work function prototype

Define a type for the work function prototype. It's not only kept in the work_struct struct, it's also passed as an argument to several functions. This makes it easier to change it.

David Howells committed 19 years ago

Commit 6bb49e51 parent 52bad643 files · +10 −9Browse files

Showing the changes to kernel/workqueue.c (1 of 3 files). Show all

Unified · Split

kernel/workqueue.c+3−3
@@ -217,7 +217,7 @@ static void run_workqueue(struct cpu_workqueue_struct *cwq) · 216 unmodified lines
217217 while (!list_empty(&cwq->worklist)) {
218218 struct work_struct *work = list_entry(cwq->worklist.next,
219219 struct work_struct, entry);
220− void (*f) (void *) = work->func;
220+ work_func_t f = work->func;
221221 void *data = work->data;
222222
223223 list_del_init(cwq->worklist.next);
@@ -513,7 +513,7 @@ EXPORT_SYMBOL(schedule_delayed_work_on); · 289 unmodified lines
513513 *
514514 * schedule_on_each_cpu() is very slow.
515515 */
516−int schedule_on_each_cpu(void (*func)(void *info), void *info)
516+int schedule_on_each_cpu(work_func_t func, void *info)
517517 {
518518 int cpu;
519519 struct work_struct *works;
@@ -578,7 +578,7 @@ EXPORT_SYMBOL(cancel_rearming_delayed_work); · 58 unmodified lines
578578 * Returns: 0 - function was executed
579579 * 1 - function was scheduled for execution
580580 */
581−int execute_in_process_context(void (*fn)(void *data), void *data,
581+int execute_in_process_context(work_func_t fn, void *data,
582582 struct execute_work *ew)
583583 {
584584 if (!in_interrupt()) {