diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2015-01-27 03:17:38 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2015-01-27 03:17:38 +0000 |
commit | 7ac4ce62e2476f05331d3c5341c866ed14b81a70 (patch) | |
tree | 21042b557424b93c264a0a6a7e93f1512d1351c8 /sys/kern | |
parent | c2499bdb5b4f1bd235843fb845b156cfeae25b83 (diff) |
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')
-rw-r--r-- | sys/kern/kern_sensors.c | 8 | ||||
-rw-r--r-- | sys/kern/kern_task.c | 10 | ||||
-rw-r--r-- | sys/kern/subr_disk.c | 8 |
3 files changed, 12 insertions, 14 deletions
diff --git a/sys/kern/kern_sensors.c b/sys/kern/kern_sensors.c index ad7cf0e6934..e9bddd8d8a8 100644 --- a/sys/kern/kern_sensors.c +++ b/sys/kern/kern_sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sensors.c,v 1.33 2014/11/14 23:26:48 tedu Exp $ */ +/* $OpenBSD: kern_sensors.c,v 1.34 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -180,7 +180,7 @@ struct sensor_task { }; void sensor_task_tick(void *); -void sensor_task_work(void *, void *); +void sensor_task_work(void *); struct sensor_task * sensor_task_register(void *arg, void (*func)(void *), unsigned int period) @@ -204,7 +204,7 @@ sensor_task_register(void *arg, void (*func)(void *), unsigned int period) st->arg = arg; st->period = period; timeout_set(&st->timeout, sensor_task_tick, st); - task_set(&st->task, sensor_task_work, st, NULL); + task_set(&st->task, sensor_task_work, st); rw_init(&st->lock, "sensor"); sensor_task_tick(st); @@ -235,7 +235,7 @@ sensor_task_tick(void *arg) } void -sensor_task_work(void *xst, void *arg) +sensor_task_work(void *xst) { struct sensor_task *st = xst; unsigned int period = 0; 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(); } diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 80dbc2efab7..7aafad75b94 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_disk.c,v 1.179 2014/12/30 04:00:33 krw Exp $ */ +/* $OpenBSD: subr_disk.c,v 1.180 2015/01/27 03:17:36 dlg Exp $ */ /* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */ /* @@ -99,7 +99,7 @@ struct disk_attach_task { struct disk *dk; }; -void disk_attach_callback(void *, void *); +void disk_attach_callback(void *); /* * Compute checksum for disk label. @@ -1105,7 +1105,7 @@ disk_attach(struct device *dv, struct disk *diskp) device_ref(dv); dat->dk = diskp; - task_set(&dat->task, disk_attach_callback, dat, NULL); + task_set(&dat->task, disk_attach_callback, dat); task_add(systq, &dat->task); } } @@ -1115,7 +1115,7 @@ disk_attach(struct device *dv, struct disk *diskp) } void -disk_attach_callback(void *xdat, void *null) +disk_attach_callback(void *xdat) { struct disk_attach_task *dat = xdat; struct disk *dk = dat->dk; |