summaryrefslogtreecommitdiffstats
path: root/sys/dev/si/si.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-01-09 03:01:45 +0000
committerpeter <peter@FreeBSD.org>1996-01-09 03:01:45 +0000
commit94d839041dd1704e405a4a987d670cb0cb94468d (patch)
treef691ddd4542ce67c8743937829af540413a8717c /sys/dev/si/si.c
parent30806f728b9ab4951188fcd9110fa7e825bac390 (diff)
downloadFreeBSD-src-94d839041dd1704e405a4a987d670cb0cb94468d.zip
FreeBSD-src-94d839041dd1704e405a4a987d670cb0cb94468d.tar.gz
clean up si_dprintf a bit so that it uses vararg argument parsing that does
not cause warnings, and uses printf() to do a vprintf()-like output.
Diffstat (limited to 'sys/dev/si/si.c')
-rw-r--r--sys/dev/si/si.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index 48d8e11..d38db1e 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -69,6 +69,7 @@ static char si_copyright1[] = "@(#) (C) Specialix International, 1990,1992",
#include <i386/isa/sireg.h>
#include <machine/si.h>
+#include <machine/stdarg.h>
#include "si.h"
@@ -129,10 +130,13 @@ static struct cdevsw si_cdevsw =
#ifdef SI_DEBUG /* use: ``options "SI_DEBUG"'' in your config file */
-/* XXX: should be varargs, I know.. but where's vprintf()? */
-static void si_dprintf __P((/* struct si_port *pp, int flags, char *str, int a1, int a2, int a3, int a4, int a5, int a6 */));
+
+static void si_dprintf __P((struct si_port *pp, int flags, const char *fmt,
+ ...));
static char *si_mctl2str __P((enum si_mctl cmd));
+
#define DPRINT(x) si_dprintf x
+
#else
#define DPRINT(x) /* void */
#endif
@@ -2327,20 +2331,27 @@ si_disc_optim(tp, t, pp)
#ifdef SI_DEBUG
+
static void
-si_dprintf(pp, flags, str, a1, a2, a3, a4, a5, a6)
+#ifdef __STDC__
+si_dprintf(struct si_port *pp, int flags, const char *fmt, ...)
+#else
+si_dprintf(pp, flags, fmt, va_alist)
struct si_port *pp;
int flags;
- char *str;
- int a1, a2, a3, a4, a5, a6;
+ char *fmt;
+#endif
{
+ va_list ap;
if ((pp == NULL && (si_debug&flags)) ||
(pp != NULL && ((pp->sp_debug&flags) || (si_debug&flags)))) {
+ va_start(ap, fmt);
if (pp != NULL)
printf("%ci%d(%d): ", 's',
(int)SI_CARD(pp->sp_tty->t_dev),
(int)SI_PORT(pp->sp_tty->t_dev));
- printf(str, a1, a2, a3, a4, a5, a6);
+ printf("%r", fmt, ap);
+ va_end(ap);
}
}
OpenPOWER on IntegriCloud