From: dlg Date: Tue, 27 Jan 2015 03:17:35 +0000 (+0000) Subject: remove the second void * argument on tasks. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e419548092f59c20a140404818050eb2ab331a19;p=openbsd 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@ --- diff --git a/share/man/man9/task_add.9 b/share/man/man9/task_add.9 index a5b516d2ff7..dbb219ca3e3 100644 --- a/share/man/man9/task_add.9 +++ b/share/man/man9/task_add.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: task_add.9,v 1.12 2014/06/11 08:47:53 blambert Exp $ +.\" $OpenBSD: task_add.9,v 1.13 2015/01/27 03:17:35 dlg Exp $ .\" .\" Copyright (c) 2013 David Gwynne .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 11 2014 $ +.Dd $Mdocdate: January 27 2015 $ .Dt TASK_ADD 9 .Os .Sh NAME @@ -32,14 +32,14 @@ .Ft void .Fn "taskq_destroy" "struct taskq *tq" .Ft void -.Fn "task_set" "struct task *t" "void (*fn)(void *, void *)" "void *arg1" "void *arg2" +.Fn "task_set" "struct task *t" "void (*fn)(void *)" "void *arg" .Ft int .Fn "task_add" "struct taskq *tq" "struct task *t" .Ft int .Fn "task_del" "struct taskq *tq" "struct task *t" .Vt extern struct taskq *const systq; .Vt extern struct taskq *const systqmp; -.Fn "TASK_INITIALIZER" "void (*fn)(void *, void *)" "void *arg1" "void *arg2" +.Fn "TASK_INITIALIZER" "void (*fn)(void *)" "void *arg" .Sh DESCRIPTION The taskq @@ -90,10 +90,8 @@ and .Fa t will be prepared to call the function .Fa fn -with the arguments specified by -.Fa arg1 -and -.Fa arg2 . +with the argument specified by +.Fa arg . Once initialised, the .Fa t structure can be used repeatedly in calls to @@ -143,10 +141,8 @@ The task will be prepared to call the function specified by the .Fa fn argument with the .Fa void * -arguments given in -.Fa arg1 -and -.Fa arg2 . +argument given in +.Fa arg . .Sh CONTEXT .Fn taskq_create and diff --git a/sys/arch/sparc64/dev/vdsp.c b/sys/arch/sparc64/dev/vdsp.c index b3e09de8f19..b7b7fe12b8c 100644 --- a/sys/arch/sparc64/dev/vdsp.c +++ b/sys/arch/sparc64/dev/vdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsp.c,v 1.36 2015/01/25 21:42:13 kettenis Exp $ */ +/* $OpenBSD: vdsp.c,v 1.37 2015/01/27 03:17:35 dlg Exp $ */ /* * Copyright (c) 2009, 2011, 2014 Mark Kettenis * @@ -294,15 +294,15 @@ void vdsp_ldc_start(struct ldc_conn *); void vdsp_sendmsg(struct vdsp_softc *, void *, size_t, int dowait); -void vdsp_open(void *, void *); -void vdsp_close(void *, void *); -void vdsp_alloc(void *, void *); +void vdsp_open(void *); +void vdsp_close(void *); +void vdsp_alloc(void *); void vdsp_readlabel(struct vdsp_softc *); int vdsp_writelabel(struct vdsp_softc *); int vdsp_is_iso(struct vdsp_softc *); -void vdsp_read(void *, void *); +void vdsp_read(void *); void vdsp_read_desc(struct vdsp_softc *, struct vdsk_desc_msg *); -void vdsp_vd_task(void *, void *); +void vdsp_vd_task(void *); void vdsp_read_dring(void *, void *); void vdsp_write_dring(void *, void *); void vdsp_flush_dring(void *, void *); @@ -378,10 +378,10 @@ vdsp_attach(struct device *parent, struct device *self, void *aux) goto free_txqueue; } - task_set(&sc->sc_open_task, vdsp_open, sc, NULL); - task_set(&sc->sc_alloc_task, vdsp_alloc, sc, NULL); - task_set(&sc->sc_close_task, vdsp_close, sc, NULL); - task_set(&sc->sc_read_task, vdsp_read, sc, NULL); + task_set(&sc->sc_open_task, vdsp_open, sc); + task_set(&sc->sc_alloc_task, vdsp_alloc, sc); + task_set(&sc->sc_close_task, vdsp_close, sc); + task_set(&sc->sc_read_task, vdsp_read, sc); printf("\n"); @@ -775,7 +775,7 @@ vdsp_rx_vio_dring_data(struct vdsp_softc *sc, struct vio_msg_tag *tag) } void -vdsp_vd_task(void *xsc, void *null) +vdsp_vd_task(void *xsc) { struct vdsp_softc *sc = xsc; struct vd_desc *vd; @@ -900,7 +900,7 @@ vdsp_sendmsg(struct vdsp_softc *sc, void *msg, size_t len, int dowait) } void -vdsp_open(void *arg1, void *null) +vdsp_open(void *arg1) { struct vdsp_softc *sc = arg1; struct proc *p = curproc; @@ -968,7 +968,7 @@ vdsp_open(void *arg1, void *null) } void -vdsp_close(void *arg1, void *null) +vdsp_close(void *arg1) { struct vdsp_softc *sc = arg1; struct proc *p = curproc; @@ -1090,7 +1090,7 @@ vdsp_is_iso(struct vdsp_softc *sc) } void -vdsp_alloc(void *arg1, void *null) +vdsp_alloc(void *arg1) { struct vdsp_softc *sc = arg1; struct vio_dring_reg dr; @@ -1101,7 +1101,7 @@ vdsp_alloc(void *arg1, void *null) sc->sc_descriptor_size, M_DEVBUF, M_WAITOK); sc->sc_vd_ring = mallocarray(sc->sc_num_descriptors, sizeof(*sc->sc_vd_ring), M_DEVBUF, M_WAITOK); - task_set(&sc->sc_vd_task, vdsp_vd_task, sc, NULL); + task_set(&sc->sc_vd_task, vdsp_vd_task, sc); bzero(&dr, sizeof(dr)); dr.tag.type = VIO_TYPE_CTRL; @@ -1113,7 +1113,7 @@ vdsp_alloc(void *arg1, void *null) } void -vdsp_read(void *arg1, void *null) +vdsp_read(void *arg1) { struct vdsp_softc *sc = arg1; diff --git a/sys/crypto/crypto.c b/sys/crypto/crypto.c index de2840a1ed3..88c6ec51960 100644 --- a/sys/crypto/crypto.c +++ b/sys/crypto/crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.c,v 1.72 2014/10/23 00:15:09 dlg Exp $ */ +/* $OpenBSD: crypto.c,v 1.73 2015/01/27 03:17:35 dlg Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -370,7 +370,7 @@ int crypto_dispatch(struct cryptop *crp) { if (crypto_taskq && !(crp->crp_flags & CRYPTO_F_NOQUEUE)) { - task_set(&crp->crp_task, (void (*))crypto_invoke, crp, NULL); + task_set(&crp->crp_task, (void (*))crypto_invoke, crp); task_add(crypto_taskq, &crp->crp_task); } else { crypto_invoke(crp); @@ -516,8 +516,7 @@ crypto_done(struct cryptop *crp) /* not from the crypto queue, wakeup the userland process */ crp->crp_callback(crp); } else { - task_set(&crp->crp_task, (void (*))crp->crp_callback, - crp, NULL); + task_set(&crp->crp_task, (void (*))crp->crp_callback, crp); task_add(crypto_taskq, &crp->crp_task); } } diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c index eaa2653bd3b..cd74e876511 100644 --- a/sys/dev/ata/atascsi.c +++ b/sys/dev/ata/atascsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.c,v 1.121 2014/12/09 07:05:06 doug Exp $ */ +/* $OpenBSD: atascsi.c,v 1.122 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -121,7 +121,7 @@ void atascsi_disk_vpd_thin(struct scsi_xfer *); void atascsi_disk_write_same_16(struct scsi_xfer *); void atascsi_disk_write_same_16_done(struct ata_xfer *); void atascsi_disk_unmap(struct scsi_xfer *); -void atascsi_disk_unmap_task(void *, void *); +void atascsi_disk_unmap_task(void *); void atascsi_disk_unmap_done(struct ata_xfer *); void atascsi_disk_capacity(struct scsi_xfer *); void atascsi_disk_capacity16(struct scsi_xfer *); @@ -1090,16 +1090,16 @@ atascsi_disk_unmap(struct scsi_xfer *xs) /* let's go */ if (ISSET(xs->flags, SCSI_NOSLEEP)) { - task_set(&xa->task, atascsi_disk_unmap_task, xs, NULL); + task_set(&xa->task, atascsi_disk_unmap_task, xs); task_add(systq, &xa->task); } else { /* we can already sleep for memory */ - atascsi_disk_unmap_task(xs, NULL); + atascsi_disk_unmap_task(xs); } } void -atascsi_disk_unmap_task(void *xxs, void *a) +atascsi_disk_unmap_task(void *xxs) { struct scsi_xfer *xs = xxs; struct scsi_link *link = xs->sc_link; diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 22687c1da4f..730d96928b0 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.126 2015/01/20 04:54:23 dlg Exp $ */ +/* $OpenBSD: audio.c,v 1.127 2015/01/27 03:17:35 dlg Exp $ */ /* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */ /* @@ -331,7 +331,7 @@ struct filterops audioread_filtops = #if NWSKBD > 0 /* Mixer manipulation using keyboard */ int wskbd_set_mixervolume(long, long); -void wskbd_set_mixervolume_callback(void *, void *); +void wskbd_set_mixervolume_callback(void *); #endif /* @@ -3448,7 +3448,7 @@ wskbd_set_mixervolume(long dir, long out) if (ch == NULL) return (ENOMEM); - task_set(&ch->t, wskbd_set_mixervolume_callback, ch, NULL); + task_set(&ch->t, wskbd_set_mixervolume_callback, ch); ch->dir = dir; ch->out = out; task_add(systq, &ch->t); @@ -3457,7 +3457,7 @@ wskbd_set_mixervolume(long dir, long out) } void -wskbd_set_mixervolume_callback(void *xch, void *null) +wskbd_set_mixervolume_callback(void *xch) { struct wskbd_vol_change *ch = xch; struct audio_softc *sc; diff --git a/sys/dev/cardbus/cardslot.c b/sys/dev/cardbus/cardslot.c index a1f46dc0ced..24feebea55d 100644 --- a/sys/dev/cardbus/cardslot.c +++ b/sys/dev/cardbus/cardslot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cardslot.c,v 1.17 2014/12/19 05:48:36 tedu Exp $ */ +/* $OpenBSD: cardslot.c,v 1.18 2015/01/27 03:17:36 dlg Exp $ */ /* $NetBSD: cardslot.c,v 1.9 2000/03/22 09:35:06 haya Exp $ */ /* @@ -61,7 +61,7 @@ STATIC void cardslotattach(struct device *, struct device *, void *); STATIC int cardslotmatch(struct device *, void *, void *); -STATIC void cardslot_event(void *arg1, void *arg2); +STATIC void cardslot_event(void *arg); STATIC void cardslot_process_event(struct cardslot_softc *); STATIC int cardslot_cb_print(void *aux, const char *pcic); @@ -111,7 +111,7 @@ cardslotattach(struct device *parent, struct device *self, void *aux) sc->sc_cb_softc = NULL; sc->sc_16_softc = NULL; SIMPLEQ_INIT(&sc->sc_events); - task_set(&sc->sc_event_task, cardslot_event, sc, NULL); + task_set(&sc->sc_event_task, cardslot_event, sc); printf(" slot %d flags %x\n", sc->sc_slot, sc->sc_dev.dv_cfdata->cf_flags); @@ -225,7 +225,7 @@ cardslot_event_throw(struct cardslot_softc *sc, int ev) * */ STATIC void -cardslot_event(void *arg1, void *arg2) +cardslot_event(void *arg1) { struct cardslot_softc *sc = arg1; diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index 196192b4e97..9a65462e31f 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.198 2014/09/17 10:11:33 dlg Exp $ */ +/* $OpenBSD: mpi.c,v 1.199 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2005, 2006, 2009 David Gwynne @@ -146,7 +146,7 @@ void mpi_eventack_done(struct mpi_ccb *); int mpi_evt_sas(struct mpi_softc *, struct mpi_rcb *); void mpi_evt_sas_detach(void *, void *); void mpi_evt_sas_detach_done(struct mpi_ccb *); -void mpi_fc_rescan(void *, void *); +void mpi_fc_rescan(void *); int mpi_req_cfg_header(struct mpi_softc *, u_int8_t, u_int8_t, u_int32_t, int, void *); @@ -222,7 +222,7 @@ mpi_attach(struct mpi_softc *sc) printf("\n"); rw_init(&sc->sc_lock, "mpi_lock"); - task_set(&sc->sc_evt_rescan, mpi_fc_rescan, sc, NULL); + task_set(&sc->sc_evt_rescan, mpi_fc_rescan, sc); /* disable interrupts */ mpi_write(sc, MPI_INTR_MASK, @@ -2473,7 +2473,7 @@ mpi_evt_sas_detach_done(struct mpi_ccb *ccb) } void -mpi_fc_rescan(void *xsc, void *null) +mpi_fc_rescan(void *xsc) { struct mpi_softc *sc = xsc; struct mpi_cfg_hdr hdr; diff --git a/sys/dev/ic/qla.c b/sys/dev/ic/qla.c index 30cbe2ce837..e603d891f66 100644 --- a/sys/dev/ic/qla.c +++ b/sys/dev/ic/qla.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qla.c,v 1.46 2014/12/19 07:23:57 deraadt Exp $ */ +/* $OpenBSD: qla.c,v 1.47 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2011 David Gwynne @@ -89,7 +89,7 @@ void qla_clear_isr(struct qla_softc *, u_int16_t); void qla_update_start(struct qla_softc *, int); void qla_update_done(struct qla_softc *, int); -void qla_do_update(void *, void*); +void qla_do_update(void *); void qla_put_marker(struct qla_softc *, void *); void qla_put_cmd(struct qla_softc *, void *, struct scsi_xfer *, @@ -649,7 +649,7 @@ qla_attach(struct qla_softc *sc) } sc->sc_update_taskq = taskq_create(DEVNAME(sc), 1, IPL_BIO); - task_set(&sc->sc_update_task, qla_do_update, sc, NULL); + task_set(&sc->sc_update_task, qla_do_update, sc); /* wait a bit for link to come up so we can scan and attach devices */ for (i = 0; i < QLA_WAIT_FOR_LOOP * 10000; i++) { @@ -667,7 +667,7 @@ qla_attach(struct qla_softc *sc) } if (sc->sc_loop_up) { - qla_do_update(sc, NULL); + qla_do_update(sc); } else { DPRINTF(QLA_D_PORT, "%s: loop still down, giving up\n", DEVNAME(sc)); @@ -1741,7 +1741,7 @@ qla_clear_port_lists(struct qla_softc *sc) } void -qla_do_update(void *xsc, void *x) +qla_do_update(void *xsc) { struct qla_softc *sc = xsc; int firstport, lastport; diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c index f56dd754de0..1b900fa4a47 100644 --- a/sys/dev/ic/qlw.c +++ b/sys/dev/ic/qlw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qlw.c,v 1.26 2014/12/19 07:23:57 deraadt Exp $ */ +/* $OpenBSD: qlw.c,v 1.27 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2011 David Gwynne @@ -76,7 +76,7 @@ int qlw_config_bus(struct qlw_softc *, int); int qlw_config_target(struct qlw_softc *, int, int); void qlw_update_bus(struct qlw_softc *, int); void qlw_update_target(struct qlw_softc *, int, int); -void qlw_update_task(void *, void *); +void qlw_update_task(void *); void qlw_handle_intr(struct qlw_softc *, u_int16_t, u_int16_t); void qlw_set_ints(struct qlw_softc *, int); @@ -173,7 +173,7 @@ qlw_attach(struct qlw_softc *sc) int reset_delay; int bus; - task_set(&sc->sc_update_task, qlw_update_task, sc, NULL); + task_set(&sc->sc_update_task, qlw_update_task, sc); switch (sc->sc_isp_gen) { case QLW_GEN_ISP1000: @@ -538,9 +538,9 @@ qlw_update_target(struct qlw_softc *sc, int bus, int target) } void -qlw_update_task(void *arg1, void *arg2) +qlw_update_task(void *xsc) { - struct qlw_softc *sc = arg1; + struct qlw_softc *sc = xsc; int bus; for (bus = 0; bus < sc->sc_numbusses; bus++) diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c index cb4995fcaa0..676b8ec97cf 100644 --- a/sys/dev/pci/arc.c +++ b/sys/dev/pci/arc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc.c,v 1.105 2015/01/12 00:07:55 dlg Exp $ */ +/* $OpenBSD: arc.c,v 1.106 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2006 David Gwynne @@ -674,7 +674,7 @@ struct arc_task { struct arc_softc *sc; }; /* sensors */ -void arc_create_sensors(void *, void *); +void arc_create_sensors(void *); void arc_refresh_sensors(void *); #endif /* SMALL_KERNEL */ #endif @@ -834,7 +834,7 @@ arc_attach(struct device *parent, struct device *self, void *aux) at = malloc(sizeof(*at), M_TEMP, M_WAITOK); at->sc = sc; - task_set(&at->t, arc_create_sensors, at, NULL); + task_set(&at->t, arc_create_sensors, at); task_add(systq, &at->t); } #endif @@ -2606,7 +2606,7 @@ arc_wait(struct arc_softc *sc) #ifndef SMALL_KERNEL void -arc_create_sensors(void *xat, void *null) +arc_create_sensors(void *xat) { struct arc_task *at = xat; struct arc_softc *sc = at->sc; diff --git a/sys/dev/pci/drm/drm_crtc_helper.c b/sys/dev/pci/drm/drm_crtc_helper.c index 4f740463494..a8f1be0ab10 100644 --- a/sys/dev/pci/drm/drm_crtc_helper.c +++ b/sys/dev/pci/drm/drm_crtc_helper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_crtc_helper.c,v 1.7 2014/03/09 11:07:18 jsg Exp $ */ +/* $OpenBSD: drm_crtc_helper.c,v 1.8 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2006-2008 Intel Corporation * Copyright (c) 2007 Dave Airlie @@ -967,7 +967,7 @@ void drm_kms_helper_hotplug_event(struct drm_device *dev) EXPORT_SYMBOL(drm_kms_helper_hotplug_event); #define DRM_OUTPUT_POLL_SECONDS 10 -static void drm_output_poll_execute(void *arg1, void *arg2) +static void drm_output_poll_execute(void *arg1) { struct drm_device *dev = (struct drm_device *)arg1; struct drm_connector *connector; @@ -1057,8 +1057,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_enable); void drm_kms_helper_poll_init(struct drm_device *dev) { - task_set(&dev->mode_config.poll_task, drm_output_poll_execute, dev, - NULL); + task_set(&dev->mode_config.poll_task, drm_output_poll_execute, dev); timeout_set(&dev->mode_config.output_poll_to, drm_output_poll_tick, dev); dev->mode_config.poll_enabled = true; diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index cca4851ddcc..b8bec4b413a 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_drv.c,v 1.69 2014/12/20 16:34:27 krw Exp $ */ +/* $OpenBSD: i915_drv.c,v 1.70 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth * @@ -599,7 +599,7 @@ int inteldrm_alloc_screen(void *, const struct wsscreen_descr *, void inteldrm_free_screen(void *, void *); int inteldrm_show_screen(void *, void *, int, void (*)(void *, int, int), void *); -void inteldrm_doswitch(void *, void *); +void inteldrm_doswitch(void *); int inteldrm_load_font(void *, void *, struct wsdisplay_font *); int inteldrm_list_font(void *, struct wsdisplay_font *); int inteldrm_getchar(void *, int, int, struct wsdisplay_charcell *); @@ -719,13 +719,13 @@ inteldrm_show_screen(void *v, void *cookie, int waitok, return (EAGAIN); } - inteldrm_doswitch(v, cookie); + inteldrm_doswitch(v); return (0); } void -inteldrm_doswitch(void *v, void *dummy) +inteldrm_doswitch(void *v) { struct inteldrm_softc *dev_priv = v; struct rasops_info *ri = &dev_priv->ro; @@ -895,7 +895,7 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) mtx_init(&dev_priv->error_completion_lock, IPL_NONE); rw_init(&dev_priv->rps.hw_lock, "rpshw"); - task_set(&dev_priv->switchtask, inteldrm_doswitch, dev_priv, NULL); + task_set(&dev_priv->switchtask, inteldrm_doswitch, dev_priv); /* we need to use this api for now due to sharing with intagp */ bar = vga_pci_bar_info(vga_sc, (IS_I9XX(dev) ? 0 : 1)); diff --git a/sys/dev/pci/drm/i915/i915_drv.h b/sys/dev/pci/drm/i915/i915_drv.h index 7c4cf650876..e7f71ba5a83 100644 --- a/sys/dev/pci/drm/i915/i915_drv.h +++ b/sys/dev/pci/drm/i915/i915_drv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_drv.h,v 1.54 2014/12/20 16:34:27 krw Exp $ */ +/* $OpenBSD: i915_drv.h,v 1.55 2015/01/27 03:17:36 dlg Exp $ */ /* i915_drv.h -- Private header for the I915 driver -*- linux-c -*- */ /* @@ -1180,7 +1180,7 @@ void i915_gem_retire_requests_ring(struct intel_ring_buffer *); int i915_gem_check_wedge(struct inteldrm_softc *, bool interruptible); -void i915_gem_retire_work_handler(void *, void*); +void i915_gem_retire_work_handler(void *); int i915_gem_idle(struct drm_device *); void i915_gem_object_move_to_active(struct drm_i915_gem_object *, struct intel_ring_buffer *); diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c index f3c5220cbe9..d42b9232ff0 100644 --- a/sys/dev/pci/drm/i915/i915_gem.c +++ b/sys/dev/pci/drm/i915/i915_gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_gem.c,v 1.78 2014/12/17 06:58:10 guenther Exp $ */ +/* $OpenBSD: i915_gem.c,v 1.79 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth * @@ -2464,7 +2464,7 @@ i915_gem_retire_requests(struct drm_device *dev) } void -i915_gem_retire_work_handler(void *arg1, void *unused) +i915_gem_retire_work_handler(void *arg1) { drm_i915_private_t *dev_priv = arg1; struct drm_device *dev; @@ -4352,7 +4352,7 @@ i915_gem_load(struct drm_device *dev) for (i = 0; i < I915_MAX_NUM_FENCES; i++) INIT_LIST_HEAD(&dev_priv->fence_regs[i].lru_list); task_set(&dev_priv->mm.retire_task, i915_gem_retire_work_handler, - dev_priv, NULL); + dev_priv); timeout_set(&dev_priv->mm.retire_timer, inteldrm_timeout, dev_priv); #if 0 init_completion(&dev_priv->error_completion); diff --git a/sys/dev/pci/drm/i915/i915_irq.c b/sys/dev/pci/drm/i915/i915_irq.c index 8f959a2a733..4ed53ad19b1 100644 --- a/sys/dev/pci/drm/i915/i915_irq.c +++ b/sys/dev/pci/drm/i915/i915_irq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_irq.c,v 1.13 2014/07/12 18:48:52 tedu Exp $ */ +/* $OpenBSD: i915_irq.c,v 1.14 2015/01/27 03:17:36 dlg Exp $ */ /* i915_irq.c -- IRQ support for the I915 -*- linux-c -*- */ /* @@ -278,7 +278,7 @@ static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe, /* * Handle hotplug events outside the interrupt handler proper. */ -static void i915_hotplug_work_func(void *arg1, void *arg2) +static void i915_hotplug_work_func(void *arg1) { drm_i915_private_t *dev_priv = (drm_i915_private_t *)arg1; struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; @@ -358,7 +358,7 @@ static void notify_ring(struct drm_device *dev, } } -static void gen6_pm_rps_work(void *arg1, void *arg2) +static void gen6_pm_rps_work(void *arg1) { drm_i915_private_t *dev_priv = arg1; struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; @@ -402,7 +402,7 @@ static void gen6_pm_rps_work(void *arg1, void *arg2) * this event, userspace should try to remap the bad rows since statistically * it is likely the same row is more likely to go bad again. */ -static void ivybridge_parity_work(void *arg1, void *arg2) +static void ivybridge_parity_work(void *arg1) { drm_i915_private_t *dev_priv = arg1; struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; @@ -832,7 +832,7 @@ done: * Fire an error uevent so userspace can see that a hang or error * was detected. */ -static void i915_error_work_func(void *arg1, void *arg2) +static void i915_error_work_func(void *arg1) { drm_i915_private_t *dev_priv = arg1; struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; @@ -2693,14 +2693,11 @@ void intel_irq_init(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; - task_set(&dev_priv->hotplug_task, i915_hotplug_work_func, - dev_priv, NULL); - task_set(&dev_priv->error_task, i915_error_work_func, - dev_priv, NULL); - task_set(&dev_priv->rps.task, gen6_pm_rps_work, - dev_priv, NULL); + task_set(&dev_priv->hotplug_task, i915_hotplug_work_func, dev_priv); + task_set(&dev_priv->error_task, i915_error_work_func, dev_priv); + task_set(&dev_priv->rps.task, gen6_pm_rps_work, dev_priv); task_set(&dev_priv->l3_parity.error_task, ivybridge_parity_work, - dev_priv, NULL); + dev_priv); dev->driver->get_vblank_counter = i915_get_vblank_counter; dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ diff --git a/sys/dev/pci/drm/i915/intel_display.c b/sys/dev/pci/drm/i915/intel_display.c index 90f3fdb9731..4488f61a7ba 100644 --- a/sys/dev/pci/drm/i915/intel_display.c +++ b/sys/dev/pci/drm/i915/intel_display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_display.c,v 1.37 2014/10/08 05:25:41 jsg Exp $ */ +/* $OpenBSD: intel_display.c,v 1.38 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright © 2006-2007 Intel Corporation * @@ -7184,7 +7184,7 @@ static void intel_crtc_destroy(struct drm_crtc *crtc) kfree(intel_crtc); } -static void intel_unpin_work_fn(void *arg1, void *arg2) +static void intel_unpin_work_fn(void *arg1) { struct intel_unpin_work *work = arg1; struct drm_device *dev = work->crtc->dev; @@ -7576,7 +7576,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, work->event = event; work->crtc = crtc; work->old_fb_obj = to_intel_framebuffer(old_fb)->obj; - task_set(&work->task, intel_unpin_work_fn, work, NULL); + task_set(&work->task, intel_unpin_work_fn, work); ret = drm_vblank_get(dev, intel_crtc->pipe); if (ret) diff --git a/sys/dev/pci/drm/i915/intel_dp.c b/sys/dev/pci/drm/i915/intel_dp.c index 486f8578a0a..fa28a84e327 100644 --- a/sys/dev/pci/drm/i915/intel_dp.c +++ b/sys/dev/pci/drm/i915/intel_dp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_dp.c,v 1.20 2014/06/19 06:51:05 jsg Exp $ */ +/* $OpenBSD: intel_dp.c,v 1.21 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright © 2008 Intel Corporation * @@ -1109,7 +1109,7 @@ static void ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp) } } -static void ironlake_panel_vdd_work(void *arg1, void *arg2) +static void ironlake_panel_vdd_work(void *arg1) { struct intel_dp *intel_dp = arg1; struct drm_device *dev = intel_dp_to_dev(intel_dp); @@ -2819,8 +2819,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, connector->interlace_allowed = true; connector->doublescan_allowed = 0; - task_set(&intel_dp->panel_vdd_task, ironlake_panel_vdd_work, intel_dp, - NULL); + task_set(&intel_dp->panel_vdd_task, ironlake_panel_vdd_work, intel_dp); timeout_set(&intel_dp->panel_vdd_to, ironlake_panel_vdd_tick, intel_dp); intel_connector_attach_encoder(intel_connector, intel_encoder); diff --git a/sys/dev/pci/drm/i915/intel_pm.c b/sys/dev/pci/drm/i915/intel_pm.c index c3079b330f3..e337f5c16b7 100644 --- a/sys/dev/pci/drm/i915/intel_pm.c +++ b/sys/dev/pci/drm/i915/intel_pm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_pm.c,v 1.21 2014/03/24 17:06:49 kettenis Exp $ */ +/* $OpenBSD: intel_pm.c,v 1.22 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright © 2012 Intel Corporation * @@ -275,7 +275,7 @@ bool intel_fbc_enabled(struct drm_device *dev) return dev_priv->display.fbc_enabled(dev); } -static void intel_fbc_work_fn(void *arg1, void *arg2) +static void intel_fbc_work_fn(void *arg1) { struct intel_fbc_work *work = arg1; struct drm_device *dev = work->crtc->dev; @@ -354,7 +354,7 @@ void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval) work->crtc = crtc; work->fb = crtc->fb; work->interval = interval; - task_set(&work->task, intel_fbc_work_fn, work, NULL); + task_set(&work->task, intel_fbc_work_fn, work); timeout_set(&work->to, intel_fbc_work_tick, work); dev_priv->fbc_work = work; @@ -3486,7 +3486,7 @@ void intel_disable_gt_powersave(struct drm_device *dev) } } -static void intel_gen6_powersave_work(void *arg1, void *arg2) +static void intel_gen6_powersave_work(void *arg1) { drm_i915_private_t *dev_priv = arg1; struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; @@ -4519,7 +4519,7 @@ void intel_pm_init(struct drm_device *dev) struct drm_i915_private *dev_priv = dev->dev_private; task_set(&dev_priv->rps.delayed_resume_task, intel_gen6_powersave_work, - dev_priv, NULL); + dev_priv); timeout_set(&dev_priv->rps.delayed_resume_to, intel_gen6_powersave_tick, dev_priv); } diff --git a/sys/dev/pci/drm/radeon/r600_audio.c b/sys/dev/pci/drm/radeon/r600_audio.c index aa62c26902f..fdd05e36e0d 100644 --- a/sys/dev/pci/drm/radeon/r600_audio.c +++ b/sys/dev/pci/drm/radeon/r600_audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: r600_audio.c,v 1.1 2013/08/12 04:11:53 jsg Exp $ */ +/* $OpenBSD: r600_audio.c,v 1.2 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -123,7 +123,7 @@ struct r600_audio r600_audio_status(struct radeon_device *rdev) * update all hdmi interfaces with current audio parameters */ void -r600_audio_update_hdmi(void *arg1, void *arg2) +r600_audio_update_hdmi(void *arg1) { struct radeon_device *rdev = arg1; struct drm_device *dev = rdev->ddev; diff --git a/sys/dev/pci/drm/radeon/radeon.h b/sys/dev/pci/drm/radeon/radeon.h index 783b9b19286..65778594414 100644 --- a/sys/dev/pci/drm/radeon/radeon.h +++ b/sys/dev/pci/drm/radeon/radeon.h @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon.h,v 1.9 2014/12/20 16:34:27 krw Exp $ */ +/* $OpenBSD: radeon.h,v 1.10 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -1957,10 +1957,10 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, int radeon_vm_bo_rmv(struct radeon_device *rdev, struct radeon_bo_va *bo_va); -void radeon_hotplug_work_func(void *arg1, void *arg2); +void radeon_hotplug_work_func(void *arg1); /* audio */ -void r600_audio_update_hdmi(void *arg1, void *arg2); +void r600_audio_update_hdmi(void *arg1); /* * R600 vram scratch functions diff --git a/sys/dev/pci/drm/radeon/radeon_display.c b/sys/dev/pci/drm/radeon/radeon_display.c index 67fbfbf4200..17b2f9bb367 100644 --- a/sys/dev/pci/drm/radeon/radeon_display.c +++ b/sys/dev/pci/drm/radeon/radeon_display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_display.c,v 1.7 2014/05/03 05:26:47 jsg Exp $ */ +/* $OpenBSD: radeon_display.c,v 1.8 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright 2007-8 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -33,7 +33,7 @@ #include #include -void radeon_unpin_work_func(void *, void *); +void radeon_unpin_work_func(void *); static void avivo_crtc_load_lut(struct drm_crtc *crtc) { @@ -249,7 +249,7 @@ static void radeon_crtc_destroy(struct drm_crtc *crtc) * Handle unpin events outside the interrupt handler proper. */ void -radeon_unpin_work_func(void *arg1, void *arg2) +radeon_unpin_work_func(void *arg1) { struct radeon_unpin_work *work = arg1; int r; @@ -387,7 +387,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc, work->fence = radeon_fence_ref(rbo->tbo.sync_obj); mtx_leave(&rbo->tbo.bdev->fence_lock); - task_set(&work->task, radeon_unpin_work_func, work, NULL); + task_set(&work->task, radeon_unpin_work_func, work); /* We borrow the event spin lock for protecting unpin_work */ mtx_enter(&dev->event_lock); diff --git a/sys/dev/pci/drm/radeon/radeon_fb.c b/sys/dev/pci/drm/radeon/radeon_fb.c index d5cfe02459f..0b0ad16683b 100644 --- a/sys/dev/pci/drm/radeon/radeon_fb.c +++ b/sys/dev/pci/drm/radeon/radeon_fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_fb.c,v 1.5 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: radeon_fb.c,v 1.6 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright © 2007 David Airlie * @@ -63,7 +63,7 @@ static struct fb_ops radeonfb_ops = { int radeonfb_create_pinned_object(struct radeon_fbdev *, struct drm_mode_fb_cmd2 *, struct drm_gem_object **); -void radeondrm_burner_cb(void *, void *); +void radeondrm_burner_cb(void *); int radeon_align_pitch(struct radeon_device *rdev, int width, int bpp, bool tiled) { @@ -426,7 +426,7 @@ int radeon_fbdev_init(struct radeon_device *rdev) return ret; } - task_set(&rdev->burner_task, radeondrm_burner_cb, rdev, NULL); + task_set(&rdev->burner_task, radeondrm_burner_cb, rdev); drm_fb_helper_single_add_all_connectors(&rfbdev->helper); #ifdef __sparc64__ @@ -516,7 +516,7 @@ radeondrm_burner(void *v, u_int on, u_int flags) } void -radeondrm_burner_cb(void *arg1, void *arg2) +radeondrm_burner_cb(void *arg1) { struct radeon_device *rdev = arg1; struct drm_fb_helper *helper = &rdev->mode_info.rfbdev->helper; diff --git a/sys/dev/pci/drm/radeon/radeon_irq_kms.c b/sys/dev/pci/drm/radeon/radeon_irq_kms.c index 6f805e10ece..affdcfd95de 100644 --- a/sys/dev/pci/drm/radeon/radeon_irq_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_irq_kms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_irq_kms.c,v 1.4 2014/04/07 06:43:11 jsg Exp $ */ +/* $OpenBSD: radeon_irq_kms.c,v 1.5 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -76,7 +76,7 @@ radeon_driver_irq_handler_kms(void *arg) * a drm hotplug event to alert userspace. */ void -radeon_hotplug_work_func(void *arg1, void *arg2) +radeon_hotplug_work_func(void *arg1) { struct radeon_device *rdev = arg1; struct drm_device *dev = rdev->ddev; @@ -250,8 +250,8 @@ int radeon_irq_kms_init(struct radeon_device *rdev) { int r = 0; - task_set(&rdev->hotplug_task, radeon_hotplug_work_func, rdev, NULL); - task_set(&rdev->audio_task, r600_audio_update_hdmi, rdev, NULL); + task_set(&rdev->hotplug_task, radeon_hotplug_work_func, rdev); + task_set(&rdev->audio_task, r600_audio_update_hdmi, rdev); mtx_init(&rdev->irq.lock, IPL_TTY); r = drm_vblank_init(rdev->ddev, rdev->num_crtc); diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c index e0204816e8e..a7aabbdf2d1 100644 --- a/sys/dev/pci/drm/radeon/radeon_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_kms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_kms.c,v 1.31 2014/12/20 16:34:27 krw Exp $ */ +/* $OpenBSD: radeon_kms.c,v 1.32 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -302,7 +302,7 @@ int radeondrm_alloc_screen(void *, const struct wsscreen_descr *, void radeondrm_free_screen(void *, void *); int radeondrm_show_screen(void *, void *, int, void (*)(void *, int, int), void *); -void radeondrm_doswitch(void *, void *); +void radeondrm_doswitch(void *); #ifdef __sparc64__ void radeondrm_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); #endif @@ -385,13 +385,13 @@ radeondrm_show_screen(void *v, void *cookie, int waitok, return (EAGAIN); } - radeondrm_doswitch(v, cookie); + radeondrm_doswitch(v); return (0); } void -radeondrm_doswitch(void *v, void *dummy) +radeondrm_doswitch(void *v) { struct rasops_info *ri = v; struct radeon_device *rdev = ri->ri_hw; @@ -698,7 +698,7 @@ radeondrm_attachhook(void *xsc) struct wsemuldisplaydev_attach_args aa; struct rasops_info *ri = &rdev->ro; - task_set(&rdev->switchtask, radeondrm_doswitch, ri, NULL); + task_set(&rdev->switchtask, radeondrm_doswitch, ri); if (ri->ri_bits == NULL) return; diff --git a/sys/dev/pci/drm/radeon/radeon_pm.c b/sys/dev/pci/drm/radeon/radeon_pm.c index f9827dcc6c3..e83300114f7 100644 --- a/sys/dev/pci/drm/radeon/radeon_pm.c +++ b/sys/dev/pci/drm/radeon/radeon_pm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_pm.c,v 1.7 2014/02/15 12:43:38 jsg Exp $ */ +/* $OpenBSD: radeon_pm.c,v 1.8 2015/01/27 03:17:36 dlg Exp $ */ /* * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -57,7 +57,7 @@ ssize_t radeon_set_pm_profile(struct device *, struct device_attribute *, ssize_t radeon_set_pm_method(struct device *, struct device_attribute *, const char *, size_t); void radeon_dynpm_idle_tick(void *); -void radeon_dynpm_idle_work_handler(void *, void *); +void radeon_dynpm_idle_work_handler(void *); extern int ticks; @@ -659,7 +659,7 @@ int radeon_pm_init(struct radeon_device *rdev) return ret; task_set(&rdev->pm.dynpm_idle_task, radeon_dynpm_idle_work_handler, - rdev, NULL); + rdev); timeout_set(&rdev->pm.dynpm_idle_to, radeon_dynpm_idle_tick, rdev); if (rdev->pm.num_power_states > 1) { @@ -829,7 +829,7 @@ radeon_dynpm_idle_tick(void *arg) } void -radeon_dynpm_idle_work_handler(void *arg1, void *arg2) +radeon_dynpm_idle_work_handler(void *arg1) { struct radeon_device *rdev = arg1; int resched; diff --git a/sys/dev/pci/drm/ttm/ttm_bo.c b/sys/dev/pci/drm/ttm/ttm_bo.c index 6b58efab9ce..a431d952429 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo.c +++ b/sys/dev/pci/drm/ttm/ttm_bo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttm_bo.c,v 1.9 2014/11/16 12:31:00 deraadt Exp $ */ +/* $OpenBSD: ttm_bo.c,v 1.10 2015/01/27 03:17:36 dlg Exp $ */ /************************************************************************** * * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA @@ -43,7 +43,7 @@ static int ttm_bo_setup_vm(struct ttm_buffer_object *bo); static int ttm_bo_swapout(struct ttm_mem_shrink *shrink); static void ttm_bo_global_kobj_release(struct ttm_bo_global *glob); -void ttm_bo_delayed_workqueue(void *, void *); +void ttm_bo_delayed_workqueue(void *); int ttm_bo_move_buffer(struct ttm_buffer_object *, struct ttm_placement *, bool, bool); @@ -713,7 +713,7 @@ static void ttm_bo_delayed_tick(void *arg) } void -ttm_bo_delayed_workqueue(void *arg1, void *arg2) +ttm_bo_delayed_workqueue(void *arg1) { struct ttm_bo_device *bdev = arg1; @@ -1592,7 +1592,7 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev, if (unlikely(ret != 0)) goto out_no_addr_mm; - task_set(&bdev->task, ttm_bo_delayed_workqueue, bdev, NULL); + task_set(&bdev->task, ttm_bo_delayed_workqueue, bdev); timeout_set(&bdev->to, ttm_bo_delayed_tick, bdev); INIT_LIST_HEAD(&bdev->ddestroy); bdev->dev_mapping = NULL; diff --git a/sys/dev/pci/drm/ttm/ttm_memory.c b/sys/dev/pci/drm/ttm/ttm_memory.c index 6c0a6e09f20..e12af2b2a4a 100644 --- a/sys/dev/pci/drm/ttm/ttm_memory.c +++ b/sys/dev/pci/drm/ttm/ttm_memory.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttm_memory.c,v 1.4 2014/02/09 10:57:26 jsg Exp $ */ +/* $OpenBSD: ttm_memory.c,v 1.5 2015/01/27 03:17:36 dlg Exp $ */ /************************************************************************** * * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA @@ -234,7 +234,7 @@ out: mtx_leave(&glob->lock); } -static void ttm_shrink_work(void *arg1, void *arg2) +static void ttm_shrink_work(void *arg1) { struct ttm_mem_global *glob = arg1; @@ -338,7 +338,7 @@ int ttm_mem_global_init(struct ttm_mem_global *glob) mtx_init(&glob->lock, IPL_TTY); glob->swap_queue = taskq_create("ttm_swap", 1, IPL_TTY); glob->task_queued = false; - task_set(&glob->task, ttm_shrink_work, glob, NULL); + task_set(&glob->task, ttm_shrink_work, glob); refcount_init(&glob->kobj_ref, 1); diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index 10317ebaf18..476d34e6c06 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.108 2014/12/22 02:28:51 tedu Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.109 2015/01/27 03:17:36 dlg Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -390,7 +390,7 @@ void bnx_tick(void *); struct rwlock bnx_tx_pool_lk = RWLOCK_INITIALIZER("bnxplinit"); struct pool *bnx_tx_pool = NULL; -void bnx_alloc_pkts(void *, void *); +void bnx_alloc_pkts(void *); /****************************************************************************/ /* OpenBSD device dispatch table. */ @@ -2595,7 +2595,7 @@ bnx_dma_alloc(struct bnx_softc *sc) TAILQ_INIT(&sc->tx_used_pkts); sc->tx_pkt_count = 0; mtx_init(&sc->tx_pkt_mtx, IPL_NET); - task_set(&sc->tx_alloc_task, bnx_alloc_pkts, sc, NULL); + task_set(&sc->tx_alloc_task, bnx_alloc_pkts, sc); /* * Allocate DMA memory for the Rx buffer descriptor chain, @@ -3727,7 +3727,7 @@ bnx_get_buf(struct bnx_softc *sc, u_int16_t *prod, } void -bnx_alloc_pkts(void *xsc, void *arg) +bnx_alloc_pkts(void *xsc) { struct bnx_softc *sc = xsc; struct ifnet *ifp = &sc->arpcom.ac_if; @@ -3825,7 +3825,7 @@ bnx_init_tx_chain(struct bnx_softc *sc) DBPRINT(sc, BNX_VERBOSE_RESET, "Entering %s()\n", __FUNCTION__); /* Force an allocation of some dmamaps for tx up front */ - bnx_alloc_pkts(sc, NULL); + bnx_alloc_pkts(sc); /* Set the initial TX producer/consumer indices. */ sc->tx_prod = 0; diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index 8a4d748cf61..24645c5d36e 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.121 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.122 2015/01/27 03:17:36 dlg Exp $ */ /*- * Copyright (c) 2004-2008 @@ -72,7 +72,7 @@ int iwi_match(struct device *, void *, void *); void iwi_attach(struct device *, struct device *, void *); int iwi_activate(struct device *, int); void iwi_wakeup(struct iwi_softc *); -void iwi_init_task(void *, void *); +void iwi_init_task(void *); int iwi_alloc_cmd_ring(struct iwi_softc *, struct iwi_cmd_ring *); void iwi_reset_cmd_ring(struct iwi_softc *, struct iwi_cmd_ring *); void iwi_free_cmd_ring(struct iwi_softc *, struct iwi_cmd_ring *); @@ -322,7 +322,7 @@ iwi_attach(struct device *parent, struct device *self, void *aux) sc->sc_txtap.wt_ihdr.it_present = htole32(IWI_TX_RADIOTAP_PRESENT); #endif - task_set(&sc->init_task, iwi_init_task, sc, NULL); + task_set(&sc->init_task, iwi_init_task, sc); return; fail: while (--ac >= 0) @@ -359,11 +359,11 @@ iwi_wakeup(struct iwi_softc *sc) data &= ~0x0000ff00; pci_conf_write(sc->sc_pct, sc->sc_pcitag, 0x40, data); - iwi_init_task(sc, NULL); + iwi_init_task(sc); } void -iwi_init_task(void *arg1, void *arg2) +iwi_init_task(void *arg1) { struct iwi_softc *sc = arg1; struct ifnet *ifp = &sc->sc_ic.ic_if; diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 5a5cdd0fcde..56867517b8c 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.137 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.138 2015/01/27 03:17:36 dlg Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini @@ -112,7 +112,7 @@ void iwn_radiotap_attach(struct iwn_softc *); int iwn_detach(struct device *, int); int iwn_activate(struct device *, int); void iwn_wakeup(struct iwn_softc *); -void iwn_init_task(void *, void *); +void iwn_init_task(void *); int iwn_nic_lock(struct iwn_softc *); int iwn_eeprom_lock(struct iwn_softc *); int iwn_init_otprom(struct iwn_softc *); @@ -533,7 +533,7 @@ iwn_attach(struct device *parent, struct device *self, void *aux) iwn_radiotap_attach(sc); #endif timeout_set(&sc->calib_to, iwn_calib_timeout, sc); - task_set(&sc->init_task, iwn_init_task, sc, NULL); + task_set(&sc->init_task, iwn_init_task, sc); return; /* Free allocated memory if something failed during attachment. */ @@ -766,11 +766,11 @@ iwn_wakeup(struct iwn_softc *sc) reg = pci_conf_read(sc->sc_pct, sc->sc_pcitag, 0x40); if (reg & 0xff00) pci_conf_write(sc->sc_pct, sc->sc_pcitag, 0x40, reg & ~0xff00); - iwn_init_task(sc, NULL); + iwn_init_task(sc); } void -iwn_init_task(void *arg1, void *arg2) +iwn_init_task(void *arg1) { struct iwn_softc *sc = arg1; struct ifnet *ifp = &sc->sc_ic.ic_if; diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 4fba795d4a9..40957698ff1 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.122 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.123 2015/01/27 03:17:36 dlg Exp $ */ /*- * Copyright (c) 2006-2008 @@ -74,7 +74,7 @@ void wpi_radiotap_attach(struct wpi_softc *); int wpi_detach(struct device *, int); int wpi_activate(struct device *, int); void wpi_wakeup(struct wpi_softc *); -void wpi_init_task(void *, void *); +void wpi_init_task(void *); int wpi_nic_lock(struct wpi_softc *); int wpi_read_prom_data(struct wpi_softc *, uint32_t, void *, int); int wpi_dma_contig_alloc(bus_dma_tag_t, struct wpi_dma_info *, @@ -324,7 +324,7 @@ wpi_attach(struct device *parent, struct device *self, void *aux) wpi_radiotap_attach(sc); #endif timeout_set(&sc->calib_to, wpi_calib_timeout, sc); - task_set(&sc->init_task, wpi_init_task, sc, NULL); + task_set(&sc->init_task, wpi_init_task, sc); return; /* Free allocated memory if something failed during attachment. */ @@ -412,11 +412,11 @@ wpi_wakeup(struct wpi_softc *sc) reg &= ~0xff00; pci_conf_write(sc->sc_pct, sc->sc_pcitag, 0x40, reg); - wpi_init_task(sc, NULL); + wpi_init_task(sc); } void -wpi_init_task(void *arg1, void *args2) +wpi_init_task(void *arg1) { struct wpi_softc *sc = arg1; struct ifnet *ifp = &sc->sc_ic.ic_if; diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c index 6ce2d4ddca9..4d68b172dd1 100644 --- a/sys/dev/pci/mpii.c +++ b/sys/dev/pci/mpii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpii.c,v 1.97 2014/09/16 05:12:04 dlg Exp $ */ +/* $OpenBSD: mpii.c,v 1.98 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2010, 2012 Mike Belopuhov * Copyright (c) 2009 James Giannoules @@ -340,7 +340,7 @@ void mpii_eventack(void *, void *); void mpii_eventack_done(struct mpii_ccb *); void mpii_event_process(struct mpii_softc *, struct mpii_rcb *); void mpii_event_done(struct mpii_softc *, struct mpii_rcb *); -void mpii_event_sas(void *, void *); +void mpii_event_sas(void *); void mpii_event_raid(struct mpii_softc *, struct mpii_msg_event_reply *); @@ -1550,7 +1550,7 @@ mpii_eventnotify(struct mpii_softc *sc) SIMPLEQ_INIT(&sc->sc_evt_sas_queue); mtx_init(&sc->sc_evt_sas_mtx, IPL_BIO); - task_set(&sc->sc_evt_sas_task, mpii_event_sas, sc, NULL); + task_set(&sc->sc_evt_sas_task, mpii_event_sas, sc); SIMPLEQ_INIT(&sc->sc_evt_ack_queue); mtx_init(&sc->sc_evt_ack_mtx, IPL_BIO); @@ -1695,7 +1695,7 @@ mpii_event_raid(struct mpii_softc *sc, struct mpii_msg_event_reply *enp) } void -mpii_event_sas(void *xsc, void *x) +mpii_event_sas(void *xsc) { struct mpii_softc *sc = xsc; struct mpii_rcb *rcb, *next; diff --git a/sys/dev/pci/ppb.c b/sys/dev/pci/ppb.c index 04b20815c47..5ae17304e62 100644 --- a/sys/dev/pci/ppb.c +++ b/sys/dev/pci/ppb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppb.c,v 1.60 2014/11/24 13:48:49 kettenis Exp $ */ +/* $OpenBSD: ppb.c,v 1.61 2015/01/27 03:17:36 dlg Exp $ */ /* $NetBSD: ppb.c,v 1.16 1997/06/06 23:48:05 thorpej Exp $ */ /* @@ -107,13 +107,13 @@ struct cfdriver ppb_cd = { void ppb_alloc_resources(struct ppb_softc *, struct pci_attach_args *); int ppb_intr(void *); -void ppb_hotplug_insert(void *, void *); +void ppb_hotplug_insert(void *); void ppb_hotplug_insert_finish(void *); int ppb_hotplug_fixup(struct pci_attach_args *); int ppb_hotplug_fixup_type0(pci_chipset_tag_t, pcitag_t, pcitag_t); int ppb_hotplug_fixup_type1(pci_chipset_tag_t, pcitag_t, pcitag_t); -void ppb_hotplug_rescan(void *, void *); -void ppb_hotplug_remove(void *, void *); +void ppb_hotplug_rescan(void *); +void ppb_hotplug_remove(void *); int ppbprint(void *, const char *pnp); int @@ -177,9 +177,9 @@ ppbattach(struct device *parent, struct device *self, void *aux) /* Check for PCI Express capabilities and setup hotplug support. */ if (pci_get_capability(pc, pa->pa_tag, PCI_CAP_PCIEXPRESS, &sc->sc_cap_off, ®) && (reg & PCI_PCIE_XCAP_SI)) { - task_set(&sc->sc_insert_task, ppb_hotplug_insert, sc, NULL); - task_set(&sc->sc_rescan_task, ppb_hotplug_rescan, sc, NULL); - task_set(&sc->sc_remove_task, ppb_hotplug_remove, sc, NULL); + task_set(&sc->sc_insert_task, ppb_hotplug_insert, sc); + task_set(&sc->sc_rescan_task, ppb_hotplug_rescan, sc); + task_set(&sc->sc_remove_task, ppb_hotplug_remove, sc); timeout_set(&sc->sc_to, ppb_hotplug_insert_finish, sc); #ifdef __i386__ @@ -676,9 +676,9 @@ extern int pci_enumerate_bus(struct pci_softc *, #endif void -ppb_hotplug_insert(void *arg1, void *arg2) +ppb_hotplug_insert(void *xsc) { - struct ppb_softc *sc = arg1; + struct ppb_softc *sc = xsc; struct pci_softc *psc = (struct pci_softc *)sc->sc_psc; if (!LIST_EMPTY(&psc->sc_devs)) @@ -790,9 +790,9 @@ ppb_hotplug_fixup_type1(pci_chipset_tag_t pc, pcitag_t tag, pcitag_t bridgetag) } void -ppb_hotplug_rescan(void *arg1, void *arg2) +ppb_hotplug_rescan(void *xsc) { - struct ppb_softc *sc = arg1; + struct ppb_softc *sc = xsc; struct pci_softc *psc = (struct pci_softc *)sc->sc_psc; if (psc) { @@ -805,9 +805,9 @@ ppb_hotplug_rescan(void *arg1, void *arg2) } void -ppb_hotplug_remove(void *arg1, void *arg2) +ppb_hotplug_remove(void *xsc) { - struct ppb_softc *sc = arg1; + struct ppb_softc *sc = xsc; struct pci_softc *psc = (struct pci_softc *)sc->sc_psc; if (psc) { diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index db578923b1d..dfebf899200 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.32 2014/09/13 16:06:37 doug Exp $ */ +/* $OpenBSD: qle.c,v 1.33 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew @@ -306,7 +306,7 @@ void qle_fabric_plogo(struct qle_softc *, struct qle_fc_port *); void qle_update_start(struct qle_softc *, int); void qle_update_done(struct qle_softc *, int); -void qle_do_update(void *, void *); +void qle_do_update(void *); int qle_async(struct qle_softc *, u_int16_t); int qle_load_fwchunk(struct qle_softc *, @@ -626,7 +626,7 @@ qle_attach(struct device *parent, struct device *self, void *aux) } sc->sc_update_taskq = taskq_create(DEVNAME(sc), 1, IPL_BIO); - task_set(&sc->sc_update_task, qle_do_update, sc, NULL); + task_set(&sc->sc_update_task, qle_do_update, sc); /* wait a bit for link to come up so we can scan and attach devices */ for (i = 0; i < QLE_WAIT_FOR_LOOP * 10000; i++) { @@ -644,7 +644,7 @@ qle_attach(struct device *parent, struct device *self, void *aux) } if (sc->sc_loop_up) { - qle_do_update(sc, NULL); + qle_do_update(sc); } else { DPRINTF(QLE_D_PORT, "%s: loop still down, giving up\n", DEVNAME(sc)); @@ -2081,7 +2081,7 @@ qle_fabric_plogo(struct qle_softc *sc, struct qle_fc_port *port) } void -qle_do_update(void *xsc, void *x) +qle_do_update(void *xsc) { struct qle_softc *sc = xsc; int firstport, lastport; diff --git a/sys/dev/pci/viomb.c b/sys/dev/pci/viomb.c index ac24f4ee2ef..60cbd61c44d 100644 --- a/sys/dev/pci/viomb.c +++ b/sys/dev/pci/viomb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: viomb.c,v 1.10 2014/07/11 08:48:38 jasper Exp $ */ +/* $OpenBSD: viomb.c,v 1.11 2015/01/27 03:17:36 dlg Exp $ */ /* $NetBSD: viomb.c,v 1.1 2011/10/30 12:12:21 hannken Exp $ */ /* @@ -106,7 +106,7 @@ struct viomb_softc { int viomb_match(struct device *, void *, void *); void viomb_attach(struct device *, struct device *, void *); -void viomb_worker(void *, void *); +void viomb_worker(void *); void viomb_inflate(struct viomb_softc *); void viomb_deflate(struct viomb_softc *); int viomb_config_change(struct virtio_softc *); @@ -205,7 +205,7 @@ viomb_attach(struct device *parent, struct device *self, void *aux) sc->sc_taskq = taskq_create("viomb", 1, IPL_BIO); if (sc->sc_taskq == NULL) goto err_dmamap; - task_set(&sc->sc_task, viomb_worker, sc, NULL); + task_set(&sc->sc_task, viomb_worker, sc); strlcpy(sc->sc_sensdev.xname, DEVNAME(sc), sizeof(sc->sc_sensdev.xname)); @@ -251,7 +251,7 @@ viomb_config_change(struct virtio_softc *vsc) } void -viomb_worker(void *arg1, void *arg2) +viomb_worker(void *arg1) { struct viomb_softc *sc = (struct viomb_softc *)arg1; int s; diff --git a/sys/dev/pci/vmwpvs.c b/sys/dev/pci/vmwpvs.c index e368d743ffd..458ae5d0cc6 100644 --- a/sys/dev/pci/vmwpvs.c +++ b/sys/dev/pci/vmwpvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmwpvs.c,v 1.10 2014/07/13 23:10:23 deraadt Exp $ */ +/* $OpenBSD: vmwpvs.c,v 1.11 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2013 David Gwynne @@ -380,7 +380,7 @@ void vmwpvs_cmd(struct vmwpvs_softc *, u_int32_t, void *, size_t); int vmwpvs_get_config(struct vmwpvs_softc *); void vmwpvs_setup_rings(struct vmwpvs_softc *); void vmwpvs_setup_msg_ring(struct vmwpvs_softc *); -void vmwpvs_msg_task(void *, void *); +void vmwpvs_msg_task(void *); struct vmwpvs_ccb * vmwpvs_scsi_cmd_poll(struct vmwpvs_softc *); @@ -423,7 +423,7 @@ vmwpvs_attach(struct device *parent, struct device *self, void *aux) sc->sc_bus_width = 16; mtx_init(&sc->sc_ring_mtx, IPL_BIO); mtx_init(&sc->sc_ccb_mtx, IPL_BIO); - task_set(&sc->sc_msg_task, vmwpvs_msg_task, sc, NULL); + task_set(&sc->sc_msg_task, vmwpvs_msg_task, sc); SIMPLEQ_INIT(&sc->sc_ccb_list); for (r = PCI_MAPREG_START; r < PCI_MAPREG_END; r += sizeof(memtype)) { @@ -767,7 +767,7 @@ vmwpvs_intr(void *xsc) } void -vmwpvs_msg_task(void *xsc, void *xnull) +vmwpvs_msg_task(void *xsc) { struct vmwpvs_softc *sc = xsc; volatile struct vmwpvw_ring_state *s = diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 6dae03cb11d..e0a59558d1d 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.37 2014/12/22 20:08:05 krw Exp $ */ +/* $OpenBSD: rasops.c,v 1.38 2015/01/27 03:17:36 dlg Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -164,7 +164,7 @@ struct rotatedfont { }; #endif -void rasops_doswitch(void *, void *); +void rasops_doswitch(void *); int rasops_vcons_cursor(void *, int, int, int); int rasops_vcons_mapchar(void *, int, u_int *); int rasops_vcons_putchar(void *, int, int, u_int, long); @@ -274,7 +274,7 @@ rasops_init(struct rasops_info *ri, int wantrows, int wantcols) ri->ri_ops.unpack_attr = rasops_vcons_unpack_attr; } - task_set(&ri->ri_switchtask, rasops_doswitch, ri, NULL); + task_set(&ri->ri_switchtask, rasops_doswitch, ri); rasops_init_devcmap(ri); return (0); @@ -1435,12 +1435,12 @@ rasops_show_screen(void *v, void *cookie, int waitok, return (EAGAIN); } - rasops_doswitch(ri, NULL); + rasops_doswitch(ri); return (0); } void -rasops_doswitch(void *v, void *dummy) +rasops_doswitch(void *v) { struct rasops_info *ri = v; struct rasops_screen *scr = ri->ri_switchcookie; diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index d5d8d888f83..3605052b0fd 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.168 2014/12/23 20:32:05 tedu Exp $ */ +/* $OpenBSD: rnd.c,v 1.169 2015/01/27 03:17:35 dlg Exp $ */ /* * Copyright (c) 2011 Theo de Raadt. @@ -531,12 +531,12 @@ extract_entropy(u_int8_t *buf) /* random keystream by ChaCha */ +void arc4_reinit(void *v); /* timeout to start reinit */ +void arc4_init(void *); /* actually do the reinit */ + struct mutex rndlock = MUTEX_INITIALIZER(IPL_HIGH); struct timeout arc4_timeout; -struct task arc4_task; - -void arc4_reinit(void *v); /* timeout to start reinit */ -void arc4_init(void *, void *); /* actually do the reinit */ +struct task arc4_task = TASK_INITIALIZER(arc4_init, NULL); static int rs_initialized; static chacha_ctx rs; /* chacha context for random keystream */ @@ -754,7 +754,7 @@ arc4random_uniform(u_int32_t upper_bound) /* ARGSUSED */ void -arc4_init(void *v, void *w) +arc4_init(void *null) { _rs_stir(1); } @@ -803,8 +803,7 @@ random_start(void) rs_initialized = 1; dequeue_randomness(NULL); - arc4_init(NULL, NULL); - task_set(&arc4_task, arc4_init, NULL, NULL); + arc4_init(NULL); timeout_set(&arc4_timeout, arc4_reinit, NULL); arc4_reinit(NULL); timeout_set(&rnd_timeout, dequeue_randomness, NULL); @@ -897,7 +896,7 @@ randomwrite(dev_t dev, struct uio *uio, int flags) } if (newdata) - arc4_init(NULL, NULL); + arc4_init(NULL); explicit_bzero(buf, POOLBYTES); free(buf, M_TEMP, POOLBYTES); diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 0c29d2010ac..b9f6643243b 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.347 2014/12/19 17:15:16 tedu Exp $ */ +/* $OpenBSD: softraid.c,v 1.348 2015/01/27 03:17:35 dlg Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom * Copyright (c) 2008 Chris Kuethe @@ -142,7 +142,7 @@ void sr_roam_chunks(struct sr_discipline *); int sr_chunk_in_use(struct sr_softc *, dev_t); int sr_rw(struct sr_softc *, dev_t, char *, size_t, daddr_t, long); -void sr_wu_done_callback(void *, void *); +void sr_wu_done_callback(void *); /* don't include these on RAMDISK */ #ifndef SMALL_KERNEL @@ -612,14 +612,14 @@ sr_meta_opt_handler(struct sr_discipline *sd, struct sr_meta_opt_hdr *om) } void -sr_meta_save_callback(void *arg1, void *arg2) +sr_meta_save_callback(void *xsd) { - struct sr_discipline *sd = arg1; + struct sr_discipline *sd = xsd; int s; s = splbio(); - if (sr_meta_save(arg1, SR_META_DIRTY)) + if (sr_meta_save(sd, SR_META_DIRTY)) printf("%s: save metadata failed\n", DEVNAME(sd->sd_sc)); sd->sd_must_flush = 0; @@ -2113,8 +2113,8 @@ sr_wu_alloc(struct sr_discipline *sd, int wu_size) wu = malloc(wu_size, M_DEVBUF, M_WAITOK | M_ZERO); TAILQ_INSERT_TAIL(&sd->sd_wu, wu, swu_next); TAILQ_INIT(&wu->swu_ccb); - task_set(&wu->swu_task, sr_wu_done_callback, sd, wu); wu->swu_dis = sd; + task_set(&wu->swu_task, sr_wu_done_callback, wu); sr_wu_put(sd, wu); } @@ -2244,10 +2244,10 @@ sr_wu_done(struct sr_workunit *wu) } void -sr_wu_done_callback(void *arg1, void *arg2) +sr_wu_done_callback(void *xwu) { - struct sr_discipline *sd = (struct sr_discipline *)arg1; - struct sr_workunit *wu = (struct sr_workunit *)arg2; + struct sr_workunit *wu = xwu; + struct sr_discipline *sd = wu->swu_dis; struct scsi_xfer *xs = wu->swu_xs; struct sr_workunit *wup; int s; @@ -2975,9 +2975,10 @@ done: } void -sr_hotspare_rebuild_callback(void *arg1, void *arg2) +sr_hotspare_rebuild_callback(void *xsd) { - sr_hotspare_rebuild((struct sr_discipline *)arg1); + struct sr_discipline *sd = xsd; + sr_hotspare_rebuild(sd); } void @@ -3920,9 +3921,9 @@ sr_discipline_init(struct sr_discipline *sd, int level) sd->sd_set_vol_state = sr_set_vol_state; sd->sd_start_discipline = NULL; - task_set(&sd->sd_meta_save_task, sr_meta_save_callback, sd, NULL); + task_set(&sd->sd_meta_save_task, sr_meta_save_callback, sd); task_set(&sd->sd_hotspare_rebuild_task, sr_hotspare_rebuild_callback, - sd, NULL); + sd); switch (level) { case 0: diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h index 3a0d75ce8bb..cd07aad8bf0 100644 --- a/sys/dev/softraidvar.h +++ b/sys/dev/softraidvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: softraidvar.h,v 1.158 2014/10/07 20:23:32 tedu Exp $ */ +/* $OpenBSD: softraidvar.h,v 1.159 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2006 Marco Peereboom * Copyright (c) 2008 Chris Kuethe @@ -636,7 +636,7 @@ void sr_hotplug_register(struct sr_discipline *, void *); void sr_hotplug_unregister(struct sr_discipline *, void *); /* Hotspare and rebuild. */ -void sr_hotspare_rebuild_callback(void *, void *); +void sr_hotspare_rebuild_callback(void *); /* work units & ccbs */ int sr_ccb_alloc(struct sr_discipline *); @@ -667,7 +667,7 @@ int sr_meta_native_read(struct sr_discipline *, dev_t, struct sr_metadata *, void *); int sr_meta_validate(struct sr_discipline *, dev_t, struct sr_metadata *, void *); -void sr_meta_save_callback(void *, void *); +void sr_meta_save_callback(void *); int sr_meta_save(struct sr_discipline *, u_int32_t); void sr_meta_getdevname(struct sr_softc *, dev_t, char *, int); diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index 64c8fc05a32..904b040e8f8 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.36 2015/01/02 10:38:22 dlg Exp $ */ +/* $OpenBSD: vscsi.c,v 1.37 2015/01/27 03:17:36 dlg Exp $ */ /* * Copyright (c) 2008 David Gwynne @@ -108,7 +108,7 @@ int vscsi_data(struct vscsi_softc *, struct vscsi_ioc_data *, int); int vscsi_t2i(struct vscsi_softc *, struct vscsi_ioc_t2i *); int vscsi_devevent(struct vscsi_softc *, u_long, struct vscsi_ioc_devevent *); -void vscsi_devevent_task(void *, void *); +void vscsi_devevent_task(void *); void vscsi_done(struct vscsi_softc *, struct vscsi_ccb *); void * vscsi_ccb_get(void *); @@ -488,7 +488,7 @@ vscsi_devevent(struct vscsi_softc *sc, u_long cmd, if (dt == NULL) return (ENOMEM); - task_set(&dt->t, vscsi_devevent_task, dt, NULL); + task_set(&dt->t, vscsi_devevent_task, dt); dt->sc = sc; dt->de = *de; dt->cmd = cmd; @@ -500,7 +500,7 @@ vscsi_devevent(struct vscsi_softc *sc, u_long cmd, } void -vscsi_devevent_task(void *xdt, void *null) +vscsi_devevent_task(void *xdt) { struct vscsi_devevent_task *dt = xdt; struct vscsi_softc *sc = dt->sc; 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 @@ -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 @@ -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; diff --git a/sys/net/if.c b/sys/net/if.c index 8cef7bbb507..4b70862449a 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.313 2015/01/21 02:23:14 guenther Exp $ */ +/* $OpenBSD: if.c,v 1.314 2015/01/27 03:17:36 dlg Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -142,7 +142,7 @@ struct if_clone *if_clone_lookup(const char *, int *); void if_congestion_clear(void *); int if_group_egress_build(void); -void if_link_state_change_task(void *, void *); +void if_link_state_change_task(void *); #ifdef DDB void ifa_print_all(void); @@ -265,8 +265,7 @@ if_attachsetup(struct ifnet *ifp) timeout_set(ifp->if_slowtimo, if_slowtimo, ifp); if_slowtimo(ifp); - task_set(ifp->if_linkstatetask, if_link_state_change_task, - ifp, NULL); + task_set(ifp->if_linkstatetask, if_link_state_change_task, ifp); /* Announce the interface. */ rt_ifannouncemsg(ifp, IFAN_ARRIVAL); @@ -1119,7 +1118,7 @@ if_link_state_change(struct ifnet *ifp) * Process a link state change. */ void -if_link_state_change_task(void *arg, void *unused) +if_link_state_change_task(void *arg) { struct ifnet *ifp = arg; int s; diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 4f02e529f3c..e75fb72f5c4 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.129 2014/12/19 17:14:39 tedu Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.130 2015/01/27 03:17:36 dlg Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. * Keepalive protocol implemented in both Cisco and PPP modes. @@ -317,7 +317,7 @@ const char *sppp_ipv6cp_opt_name(u_char opt); void sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src, struct in6_addr *dst, struct in6_addr *srcmask); void sppp_set_ip6_addr(struct sppp *sp, const struct in6_addr *src, const struct in6_addr *dst); -void sppp_update_ip6_addr(void *arg1, void *arg2); +void sppp_update_ip6_addr(void *sp); void sppp_suggest_ip6_addr(struct sppp *sp, struct in6_addr *suggest); void sppp_pap_input(struct sppp *sp, struct mbuf *m); @@ -358,8 +358,8 @@ void sppp_print_string(const char *p, u_short len); void sppp_qflush(struct ifqueue *ifq); int sppp_update_gw_walker(struct radix_node *rn, void *arg, u_int); void sppp_update_gw(struct ifnet *ifp); -void sppp_set_ip_addrs(void *, void *); -void sppp_clear_ip_addrs(void *, void *); +void sppp_set_ip_addrs(void *); +void sppp_clear_ip_addrs(void *); void sppp_set_phase(struct sppp *sp); /* our control protocol descriptors */ @@ -2609,8 +2609,8 @@ sppp_ipcp_init(struct sppp *sp) sp->ipcp.flags = 0; sp->state[IDX_IPCP] = STATE_INITIAL; sp->fail_counter[IDX_IPCP] = 0; - task_set(&sp->ipcp.set_addr_task, sppp_set_ip_addrs, sp, NULL); - task_set(&sp->ipcp.clear_addr_task, sppp_clear_ip_addrs, sp, NULL); + task_set(&sp->ipcp.set_addr_task, sppp_set_ip_addrs, sp); + task_set(&sp->ipcp.clear_addr_task, sppp_clear_ip_addrs, sp); } void @@ -3058,8 +3058,7 @@ sppp_ipv6cp_init(struct sppp *sp) sp->ipv6cp.flags = 0; sp->state[IDX_IPV6CP] = STATE_INITIAL; sp->fail_counter[IDX_IPV6CP] = 0; - task_set(&sp->ipv6cp.set_addr_task, sppp_update_ip6_addr, sp, - &sp->ipv6cp.req_ifid); + task_set(&sp->ipv6cp.set_addr_task, sppp_update_ip6_addr, sp); } void @@ -4558,7 +4557,7 @@ sppp_update_gw(struct ifnet *ifp) * If an address is 0, leave it the way it is. */ void -sppp_set_ip_addrs(void *arg1, void *arg2) +sppp_set_ip_addrs(void *arg1) { struct sppp *sp = arg1; u_int32_t myaddr; @@ -4631,7 +4630,7 @@ sppp_set_ip_addrs(void *arg1, void *arg2) * Clear IP addresses. */ void -sppp_clear_ip_addrs(void *arg1, void *arg2) +sppp_clear_ip_addrs(void *arg1) { struct sppp *sp = (struct sppp *)arg1; struct ifnet *ifp = &sp->pp_if; @@ -4728,11 +4727,11 @@ sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src, struct in6_addr *dst, /* Task to update my IPv6 address from process context. */ void -sppp_update_ip6_addr(void *arg1, void *arg2) +sppp_update_ip6_addr(void *arg) { - struct sppp *sp = arg1; + struct sppp *sp = arg; struct ifnet *ifp = &sp->pp_if; - struct in6_aliasreq *ifra = arg2; + struct in6_aliasreq *ifra = &sp->ipv6cp.req_ifid; struct in6_addr mask = in6mask128; struct in6_ifaddr *ia6; int s, error; diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index c340b200852..b5a69025381 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.129 2015/01/13 23:16:59 stsp Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.130 2015/01/27 03:17:36 dlg Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -131,7 +131,7 @@ void ieee80211_bar_tid(struct ieee80211com *, struct ieee80211_node *, #endif void ieee80211_input_print(struct ieee80211com *, struct ifnet *, struct ieee80211_frame *, struct ieee80211_rxinfo *); -void ieee80211_input_print_task(void *, void *); +void ieee80211_input_print_task(void *); struct ieee80211printmsg { struct task task; @@ -164,7 +164,7 @@ ieee80211_get_hdrlen(const struct ieee80211_frame *wh) * frames are received and the interface is put in debug mode. */ void -ieee80211_input_print_task(void *arg1, void *arg2) +ieee80211_input_print_task(void *arg1) { struct ieee80211printmsg *msg = arg1; @@ -214,7 +214,7 @@ ieee80211_input_print(struct ieee80211com *ic, struct ifnet *ifp, ieee80211_phymode_name[ieee80211_chan2mode( ic, ic->ic_bss->ni_chan)]); - task_set(&msg->task, ieee80211_input_print_task, msg, NULL); + task_set(&msg->task, ieee80211_input_print_task, msg); task_add(systq, &msg->task); } diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 9bf0232d280..7d0ff1e66c4 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.129 2015/01/08 14:29:18 mpi Exp $ */ +/* $OpenBSD: nd6.c,v 1.130 2015/01/27 03:17:36 dlg Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -100,7 +100,7 @@ void nd6_llinfo_timer(void *); struct timeout nd6_slowtimo_ch; struct timeout nd6_timer_ch; struct task nd6_timer_task; -void nd6_timer_work(void *, void *); +void nd6_timer_work(void *); struct timeout nd6_rs_output_timer; int nd6_rs_output_timeout = ND6_RS_OUTPUT_INTERVAL; @@ -134,7 +134,7 @@ nd6_init(void) /* initialization of the default router list */ TAILQ_INIT(&nd_defrouter); - task_set(&nd6_timer_task, nd6_timer_work, NULL, NULL); + task_set(&nd6_timer_task, nd6_timer_work, NULL); nd6_init_done = 1; @@ -493,7 +493,7 @@ nd6_llinfo_timer(void *arg) * ND6 timer routine to expire default route list and prefix list */ void -nd6_timer_work(void *ignored_arg1, void *ignored_arg2) +nd6_timer_work(void *null) { int s; struct nd_defrouter *dr, *ndr; diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index f6e4b9c20dc..4e40d118c94 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.96 2014/12/22 11:17:20 mpi Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.97 2015/01/27 03:17:36 dlg Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -74,7 +74,7 @@ void in6_init_address_ltimes(struct nd_prefix *, struct in6_addrlifetime *); int rt6_deleteroute(struct radix_node *, void *, u_int); -void nd6_addr_add(void *, void *); +void nd6_addr_add(void *); extern int nd6_recalc_reachtm_interval; @@ -1045,7 +1045,7 @@ nd6_prelist_add(struct nd_prefix *pr, struct nd_defrouter *dr, new->ndpr_prefix.sin6_addr.s6_addr32[i] &= new->ndpr_mask.s6_addr32[i]; - task_set(&new->ndpr_task, nd6_addr_add, new, NULL); + task_set(&new->ndpr_task, nd6_addr_add, new); s = splsoftnet(); /* link ndpr_entry to nd_prefix list */ @@ -1396,7 +1396,7 @@ prelist_update(struct nd_prefix *new, struct nd_defrouter *dr, struct mbuf *m) } void -nd6_addr_add(void *prptr, void *arg2) +nd6_addr_add(void *prptr) { struct nd_prefix *pr = (struct nd_prefix *)prptr; struct in6_ifaddr *ia6; diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index c6b375a7abb..71d726003fa 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.217 2014/09/20 16:18:23 kettenis Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.218 2015/01/27 03:17:37 dlg Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -73,8 +73,8 @@ struct scsi_plug { int how; }; -void scsi_plug_probe(void *, void *); -void scsi_plug_detach(void *, void *); +void scsi_plug_probe(void *); +void scsi_plug_detach(void *); struct scsi_xfer * scsi_xs_io(struct scsi_link *, void *, int); @@ -145,7 +145,7 @@ scsi_req_probe(struct scsibus_softc *sc, int target, int lun) if (p == NULL) return (ENOMEM); - task_set(&p->task, scsi_plug_probe, p, NULL); + task_set(&p->task, scsi_plug_probe, p); p->sc = sc; p->target = target; p->lun = lun; @@ -164,7 +164,7 @@ scsi_req_detach(struct scsibus_softc *sc, int target, int lun, int how) if (p == NULL) return (ENOMEM); - task_set(&p->task, scsi_plug_detach, p, NULL); + task_set(&p->task, scsi_plug_detach, p); p->sc = sc; p->target = target; p->lun = lun; @@ -176,7 +176,7 @@ scsi_req_detach(struct scsibus_softc *sc, int target, int lun, int how) } void -scsi_plug_probe(void *xp, void *null) +scsi_plug_probe(void *xp) { struct scsi_plug *p = xp; struct scsibus_softc *sc = p->sc; @@ -188,7 +188,7 @@ scsi_plug_probe(void *xp, void *null) } void -scsi_plug_detach(void *xp, void *null) +scsi_plug_detach(void *xp) { struct scsi_plug *p = xp; struct scsibus_softc *sc = p->sc; diff --git a/sys/sys/task.h b/sys/sys/task.h index fc19aa5f83d..9eef0adc019 100644 --- a/sys/sys/task.h +++ b/sys/sys/task.h @@ -1,4 +1,4 @@ -/* $OpenBSD: task.h,v 1.6 2014/06/11 08:47:53 blambert Exp $ */ +/* $OpenBSD: task.h,v 1.7 2015/01/27 03:17:37 dlg Exp $ */ /* * Copyright (c) 2013 David Gwynne @@ -25,9 +25,8 @@ struct taskq; struct task { TAILQ_ENTRY(task) t_entry; - void (*t_func)(void *, void *); - void *t_arg1; - void *t_arg2; + void (*t_func)(void *); + void *t_arg; unsigned int t_flags; }; @@ -38,13 +37,12 @@ extern struct taskq *const systqmp; struct taskq *taskq_create(const char *, unsigned int, int); void taskq_destroy(struct taskq *); -void task_set(struct task *, void (*)(void *, void *), - void *, void *); +void task_set(struct task *, void (*)(void *), void *); int task_add(struct taskq *, struct task *); int task_del(struct taskq *, struct task *); -#define TASK_INITIALIZER(_f, _a1, _a2) \ - { { NULL, NULL }, (_f), (_a1), (_a2), 0 } +#define TASK_INITIALIZER(_f, _a) \ + { { NULL, NULL }, (_f), (_a), 0 } #endif /* _KERNEL */ diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index da3367f2605..c0df4e59649 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap.c,v 1.133 2015/01/13 02:24:26 dlg Exp $ */ +/* $OpenBSD: uvm_swap.c,v 1.134 2015/01/27 03:17:37 dlg Exp $ */ /* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */ /* @@ -231,7 +231,7 @@ int swap_off(struct proc *, struct swapdev *); void sw_reg_strategy(struct swapdev *, struct buf *, int); void sw_reg_iodone(struct buf *); -void sw_reg_iodone_internal(void *, void *); +void sw_reg_iodone_internal(void *); void sw_reg_start(struct swapdev *); int uvm_swap_io(struct vm_page **, int, int, int); @@ -1231,7 +1231,7 @@ sw_reg_strategy(struct swapdev *sdp, struct buf *bp, int bn) /* patch it back to the vnx */ nbp->vb_vnx = vnx; - task_set(&nbp->vb_task, sw_reg_iodone_internal, nbp, NULL); + task_set(&nbp->vb_task, sw_reg_iodone_internal, nbp); s = splbio(); if (vnx->vx_error != 0) { @@ -1315,7 +1315,7 @@ sw_reg_iodone(struct buf *bp) } void -sw_reg_iodone_internal(void *xvbp, void *null) +sw_reg_iodone_internal(void *xvbp) { struct vndbuf *vbp = xvbp; struct vndxfer *vnx = vbp->vb_vnx;