summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_task.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-01-27 03:17:35 +0000
committerdlg <dlg@openbsd.org>2015-01-27 03:17:35 +0000
commite419548092f59c20a140404818050eb2ab331a19 (patch)
treeff250435e8b28c07c967073741c21d374241b774 /sys/kern/kern_task.c
parentRemove an unused and confusing assignment that had been commented out for (diff)
downloadwireguard-openbsd-e419548092f59c20a140404818050eb2ab331a19.tar.xz
wireguard-openbsd-e419548092f59c20a140404818050eb2ab331a19.zip
remove the second void * argument on tasks.
when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
Diffstat (limited to 'sys/kern/kern_task.c')
-rw-r--r--sys/kern/kern_task.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/kern_task.c b/sys/kern/kern_task.c
index 51d12200007..b0b6457509e 100644
--- a/sys/kern/kern_task.c
+++ b/sys/kern/kern_task.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_task.c,v 1.12 2014/11/01 23:58:28 tedu Exp $ */
+/* $OpenBSD: kern_task.c,v 1.13 2015/01/27 03:17:36 dlg Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
@@ -178,12 +178,10 @@ taskq_create_thread(void *arg)
}
void
-task_set(struct task *t, void (*fn)(void *, void *), void *arg1, void *arg2)
+task_set(struct task *t, void (*fn)(void *), void *arg)
{
t->t_func = fn;
- t->t_arg1 = arg1;
- t->t_arg2 = arg2;
-
+ t->t_arg = arg;
t->t_flags = 0;
}
@@ -262,7 +260,7 @@ taskq_thread(void *xtq)
KERNEL_UNLOCK();
while (taskq_next_work(tq, &work)) {
- (*work.t_func)(work.t_arg1, work.t_arg2);
+ (*work.t_func)(work.t_arg);
sched_pause();
}