summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-11-18 20:21:50 +0000
committerderaadt <deraadt@openbsd.org>2013-11-18 20:21:50 +0000
commit2d25794915b1a72ef7ffbd4e4ff3fd6fe3543962 (patch)
tree1c154aa3d433087b3e762d389bdd8a35610f66da /sys/dev
parent- ansify some function definitions (diff)
downloadwireguard-openbsd-2d25794915b1a72ef7ffbd4e4ff3fd6fe3543962.tar.xz
wireguard-openbsd-2d25794915b1a72ef7ffbd4e4ff3fd6fe3543962.zip
simplify kthread_create(). no more stdarg
ok matthew guenther mikeb
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/hil/hil.c4
-rw-r--r--sys/dev/ic/aac.c4
-rw-r--r--sys/dev/ic/i82365.c7
-rw-r--r--sys/dev/ic/tcic2.c7
-rw-r--r--sys/dev/ic/twe.c4
-rw-r--r--sys/dev/onewire/onewire.c4
-rw-r--r--sys/dev/sbus/stp4020.c5
-rw-r--r--sys/dev/sdmmc/sdmmc.c4
-rw-r--r--sys/dev/usb/usbf.c4
9 files changed, 22 insertions, 21 deletions
diff --git a/sys/dev/hil/hil.c b/sys/dev/hil/hil.c
index 3d48f8daca3..5bab6695a50 100644
--- a/sys/dev/hil/hil.c
+++ b/sys/dev/hil/hil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hil.c,v 1.24 2010/11/20 16:45:46 miod Exp $ */
+/* $OpenBSD: hil.c,v 1.25 2013/11/18 20:21:51 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004, Miodrag Vallat.
* All rights reserved.
@@ -252,7 +252,7 @@ hil_attach_deferred(void *v)
* Create asynchronous loop event handler thread.
*/
if (kthread_create(hil_thread, sc, &sc->sc_thread,
- "%s", sc->sc_dev.dv_xname) != 0) {
+ sc->sc_dev.dv_xname) != 0) {
printf("%s: unable to create event thread\n",
sc->sc_dev.dv_xname);
return;
diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c
index 851cb0cb4c1..10c17978e05 100644
--- a/sys/dev/ic/aac.c
+++ b/sys/dev/ic/aac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aac.c,v 1.57 2013/11/13 05:47:58 mlarkin Exp $ */
+/* $OpenBSD: aac.c,v 1.58 2013/11/18 20:21:51 deraadt Exp $ */
/*-
* Copyright (c) 2000 Michael Smith
@@ -284,7 +284,7 @@ aac_create_thread(void *arg)
{
struct aac_softc *sc = arg;
- if (kthread_create(aac_command_thread, sc, &sc->aifthread, "%s",
+ if (kthread_create(aac_command_thread, sc, &sc->aifthread,
sc->aac_dev.dv_xname)) {
/* TODO disable aac */
printf("%s: failed to create kernel thread, disabled",
diff --git a/sys/dev/ic/i82365.c b/sys/dev/ic/i82365.c
index 47a30f2048c..ebb87061422 100644
--- a/sys/dev/ic/i82365.c
+++ b/sys/dev/ic/i82365.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82365.c,v 1.29 2010/09/06 19:20:21 deraadt Exp $ */
+/* $OpenBSD: i82365.c,v 1.30 2013/11/18 20:21:51 deraadt Exp $ */
/* $NetBSD: i82365.c,v 1.10 1998/06/09 07:36:55 thorpej Exp $ */
/*
@@ -386,6 +386,7 @@ pcic_create_event_thread(arg)
void *arg;
{
struct pcic_handle *h = arg;
+ char name[MAXCOMLEN+1];
const char *cs;
switch (h->sock) {
@@ -405,8 +406,8 @@ pcic_create_event_thread(arg)
panic("pcic_create_event_thread: unknown pcic socket");
}
- if (kthread_create(pcic_event_thread, h, &h->event_thread,
- "%s,%s", h->ph_parent->dv_xname, cs)) {
+ snprintf(name, sizeof name, "%s,%s", h->ph_parent->dv_xname, cs);
+ if (kthread_create(pcic_event_thread, h, &h->event_thread, name)) {
printf("%s: unable to create event thread for sock 0x%02x\n",
h->ph_parent->dv_xname, h->sock);
panic("pcic_create_event_thread");
diff --git a/sys/dev/ic/tcic2.c b/sys/dev/ic/tcic2.c
index 67308e1b7fe..83742e3d39d 100644
--- a/sys/dev/ic/tcic2.c
+++ b/sys/dev/ic/tcic2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcic2.c,v 1.8 2007/11/25 16:40:04 jmc Exp $ */
+/* $OpenBSD: tcic2.c,v 1.9 2013/11/18 20:21:51 deraadt Exp $ */
/* $NetBSD: tcic2.c,v 1.3 2000/01/13 09:38:17 joda Exp $ */
#undef TCICDEBUG
@@ -446,6 +446,7 @@ tcic_create_event_thread(arg)
void *arg;
{
struct tcic_handle *h = arg;
+ char name[MAXCOMLEN+1];
const char *cs;
switch (h->sock) {
@@ -459,8 +460,8 @@ tcic_create_event_thread(arg)
panic("tcic_create_event_thread: unknown tcic socket");
}
- if (kthread_create(tcic_event_thread, h, &h->event_thread,
- "%s,%s", h->sc->dev.dv_xname, cs)) {
+ snprintf(name, sizeof name, "%s,%s", h->sc->dev.dv_xname, cs);
+ if (kthread_create(tcic_event_thread, h, &h->event_thread, name)) {
printf("%s: unable to create event thread for sock 0x%02x\n",
h->sc->dev.dv_xname, h->sock);
panic("tcic_create_event_thread");
diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c
index d1aca481b44..a2ad3c3d0cc 100644
--- a/sys/dev/ic/twe.c
+++ b/sys/dev/ic/twe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: twe.c,v 1.41 2011/07/17 22:46:48 matthew Exp $ */
+/* $OpenBSD: twe.c,v 1.42 2013/11/18 20:21:51 deraadt Exp $ */
/*
* Copyright (c) 2000-2002 Michael Shalayeff. All rights reserved.
@@ -419,7 +419,7 @@ twe_thread_create(void *v)
struct twe_softc *sc = v;
if (kthread_create(twe_thread, sc, &sc->sc_thread,
- "%s", sc->sc_dev.dv_xname)) {
+ sc->sc_dev.dv_xname)) {
/* TODO disable twe */
printf("%s: failed to create kernel thread, disabled\n",
sc->sc_dev.dv_xname);
diff --git a/sys/dev/onewire/onewire.c b/sys/dev/onewire/onewire.c
index 745fd594c17..7cf3eff1875 100644
--- a/sys/dev/onewire/onewire.c
+++ b/sys/dev/onewire/onewire.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: onewire.c,v 1.13 2013/04/10 01:35:55 guenther Exp $ */
+/* $OpenBSD: onewire.c,v 1.14 2013/11/18 20:21:51 deraadt Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -415,7 +415,7 @@ onewire_createthread(void *arg)
struct onewire_softc *sc = arg;
if (kthread_create(onewire_thread, sc, &sc->sc_thread,
- "%s", sc->sc_dev.dv_xname) != 0)
+ sc->sc_dev.dv_xname) != 0)
printf("%s: can't create kernel thread\n",
sc->sc_dev.dv_xname);
}
diff --git a/sys/dev/sbus/stp4020.c b/sys/dev/sbus/stp4020.c
index 63645b3bc7d..e0c156e7b59 100644
--- a/sys/dev/sbus/stp4020.c
+++ b/sys/dev/sbus/stp4020.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stp4020.c,v 1.16 2009/04/10 20:54:58 miod Exp $ */
+/* $OpenBSD: stp4020.c,v 1.17 2013/11/18 20:21:51 deraadt Exp $ */
/* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem Exp $ */
/*-
@@ -295,10 +295,9 @@ stp4020_create_event_thread(arg)
void *arg;
{
struct stp4020_softc *sc = arg;
- const char *name = sc->sc_dev.dv_xname;
if (kthread_create(stp4020_event_thread, sc, &sc->event_thread,
- "%s", name)) {
+ sc->sc_dev.dv_xname)) {
panic("%s: unable to create event thread", name);
}
}
diff --git a/sys/dev/sdmmc/sdmmc.c b/sys/dev/sdmmc/sdmmc.c
index 2129b3fbb6c..33cd8acff43 100644
--- a/sys/dev/sdmmc/sdmmc.c
+++ b/sys/dev/sdmmc/sdmmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc.c,v 1.28 2013/09/12 11:54:04 rapha Exp $ */
+/* $OpenBSD: sdmmc.c,v 1.29 2013/11/18 20:21:51 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -176,7 +176,7 @@ sdmmc_create_thread(void *arg)
struct sdmmc_softc *sc = arg;
if (kthread_create(sdmmc_task_thread, sc, &sc->sc_task_thread,
- "%s", DEVNAME(sc)) != 0)
+ DEVNAME(sc)) != 0)
printf("%s: can't create task thread\n", DEVNAME(sc));
}
diff --git a/sys/dev/usb/usbf.c b/sys/dev/usb/usbf.c
index 8f42e158c3c..75099d48965 100644
--- a/sys/dev/usb/usbf.c
+++ b/sys/dev/usb/usbf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbf.c,v 1.15 2013/04/15 09:23:02 mglocker Exp $ */
+/* $OpenBSD: usbf.c,v 1.16 2013/11/18 20:21:51 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -225,7 +225,7 @@ usbf_create_thread(void *arg)
{
struct usbf_softc *sc = arg;
- if (kthread_create(usbf_task_thread, sc, &sc->sc_proc, "%s",
+ if (kthread_create(usbf_task_thread, sc, &sc->sc_proc,
DEVNAME(sc)) != 0) {
printf("%s: can't create task thread\n", DEVNAME(sc));
return;