Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/isa replace 7 identical instances if cfprint functio...



details:   https://anonhg.NetBSD.org/src/rev/919d40a05fce
branches:  trunk
changeset: 569957:919d40a05fce
user:      drochner <drochner%NetBSD.org@localhost>
date:      Tue Sep 14 17:19:34 2004 +0000

description:
replace 7 identical instances if cfprint functions by a single one

diffstat:

 sys/dev/isa/addcom_isa.c    |  18 +++---------------
 sys/dev/isa/ast.c           |  20 +++-----------------
 sys/dev/isa/boca.c          |  20 +++-----------------
 sys/dev/isa/com_multi.h     |   4 +++-
 sys/dev/isa/commultiprint.c |  18 ++++++++++++++++++
 sys/dev/isa/files.isa       |   3 ++-
 sys/dev/isa/ioat66.c        |  20 +++-----------------
 sys/dev/isa/moxa_isa.c      |  20 +++-----------------
 sys/dev/isa/rtfps.c         |  20 +++-----------------
 sys/dev/isa/tcom.c          |  20 +++-----------------
 10 files changed, 44 insertions(+), 119 deletions(-)

diffs (truncated from 437 to 300 lines):

diff -r bb13a9fcac13 -r 919d40a05fce sys/dev/isa/addcom_isa.c
--- a/sys/dev/isa/addcom_isa.c  Tue Sep 14 16:59:40 2004 +0000
+++ b/sys/dev/isa/addcom_isa.c  Tue Sep 14 17:19:34 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: addcom_isa.c,v 1.9 2003/12/04 13:57:30 keihan Exp $    */
+/*     $NetBSD: addcom_isa.c,v 1.10 2004/09/14 17:19:34 drochner Exp $ */
 
 /*
  * Copyright (c) 2000 Michael Graff.  All rights reserved.
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: addcom_isa.c,v 1.9 2003/12/04 13:57:30 keihan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: addcom_isa.c,v 1.10 2004/09/14 17:19:34 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -108,7 +108,6 @@
 int addcomprobe __P((struct device *, struct cfdata *, void *));
 void addcomattach __P((struct device *, struct device *, void *));
 int addcomintr __P((void *));
-int addcomprint __P((void *, const char *));
 
 CFATTACH_DECL(addcom_isa, sizeof(struct addcom_softc),
     addcomprobe, addcomattach, NULL, NULL);
@@ -184,17 +183,6 @@
        return (rv);
 }
 
-int
-addcomprint(void *aux, const char *pnp)
-{
-       struct commulti_attach_args *ca = aux;
-
-       if (pnp)
-               aprint_normal("com at %s", pnp);
-       aprint_normal(" slave %d", ca->ca_slave);
-       return (UNCONF);
-}
-
 void
 addcomattach(struct device *parent, struct device *self, void *aux)
 {
@@ -237,7 +225,7 @@
                        - SLAVE_IOBASE_OFFSET;
                ca.ca_noien = 0;
 
-               sc->sc_slaves[i] = config_found(self, &ca, addcomprint);
+               sc->sc_slaves[i] = config_found(self, &ca, commultiprint);
                if (sc->sc_slaves[i] != NULL)
                        sc->sc_alive |= 1 << i;
        }
diff -r bb13a9fcac13 -r 919d40a05fce sys/dev/isa/ast.c
--- a/sys/dev/isa/ast.c Tue Sep 14 16:59:40 2004 +0000
+++ b/sys/dev/isa/ast.c Tue Sep 14 17:19:34 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ast.c,v 1.52 2003/01/01 00:10:20 thorpej Exp $ */
+/*     $NetBSD: ast.c,v 1.53 2004/09/14 17:19:34 drochner Exp $        */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.52 2003/01/01 00:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.53 2004/09/14 17:19:34 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -67,7 +67,6 @@
 int astprobe __P((struct device *, struct cfdata *, void *));
 void astattach __P((struct device *, struct device *, void *));
 int astintr __P((void *));
-int astprint __P((void *, const char *));
 
 CFATTACH_DECL(ast, sizeof(struct ast_softc),
     astprobe, astattach, NULL, NULL);
@@ -145,19 +144,6 @@
        return (rv);
 }
 
-int
-astprint(aux, pnp)
-       void *aux;
-       const char *pnp;
-{
-       struct commulti_attach_args *ca = aux;
-
-       if (pnp)
-               aprint_normal("com at %s", pnp);
-       aprint_normal(" slave %d", ca->ca_slave);
-       return (UNCONF);
-}
-
 void
 astattach(parent, self, aux)
        struct device *parent, *self;
@@ -197,7 +183,7 @@
                ca.ca_iobase = sc->sc_iobase + i * COM_NPORTS;
                ca.ca_noien = 1;
 
-               sc->sc_slaves[i] = config_found(self, &ca, astprint);
+               sc->sc_slaves[i] = config_found(self, &ca, commultiprint);
                if (sc->sc_slaves[i] != NULL)
                        sc->sc_alive |= 1 << i;
        }
diff -r bb13a9fcac13 -r 919d40a05fce sys/dev/isa/boca.c
--- a/sys/dev/isa/boca.c        Tue Sep 14 16:59:40 2004 +0000
+++ b/sys/dev/isa/boca.c        Tue Sep 14 17:19:34 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boca.c,v 1.41 2003/01/01 00:10:20 thorpej Exp $        */
+/*     $NetBSD: boca.c,v 1.42 2004/09/14 17:19:34 drochner Exp $       */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: boca.c,v 1.41 2003/01/01 00:10:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: boca.c,v 1.42 2004/09/14 17:19:34 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -71,7 +71,6 @@
 void bocaattach __P((struct device *, struct device *, void *));
 int bocaintr __P((void *));
 void boca_fixup __P((void *));
-int bocaprint __P((void *, const char *));
 
 CFATTACH_DECL(boca, sizeof(struct boca_softc),
     bocaprobe, bocaattach, NULL, NULL);
@@ -150,19 +149,6 @@
        return (rv);
 }
 
-int
-bocaprint(aux, pnp)
-       void *aux;
-       const char *pnp;
-{
-       struct commulti_attach_args *ca = aux;
-
-       if (pnp)
-               aprint_normal("com at %s", pnp);
-       aprint_normal(" slave %d", ca->ca_slave);
-       return (UNCONF);
-}
-
 void
 bocaattach(parent, self, aux)
        struct device *parent, *self;
@@ -198,7 +184,7 @@
                ca.ca_iobase = sc->sc_iobase + i * COM_NPORTS;
                ca.ca_noien = 0;
 
-               sc->sc_slaves[i] = config_found(self, &ca, bocaprint);
+               sc->sc_slaves[i] = config_found(self, &ca, commultiprint);
                if (sc->sc_slaves[i] != NULL)
                        sc->sc_alive |= 1 << i;
        }
diff -r bb13a9fcac13 -r 919d40a05fce sys/dev/isa/com_multi.h
--- a/sys/dev/isa/com_multi.h   Tue Sep 14 16:59:40 2004 +0000
+++ b/sys/dev/isa/com_multi.h   Tue Sep 14 17:19:34 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_multi.h,v 1.1 1997/04/04 20:56:38 mycroft Exp $    */
+/*     $NetBSD: com_multi.h,v 1.2 2004/09/14 17:19:34 drochner Exp $   */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -38,3 +38,5 @@
        int             ca_iobase;
        int             ca_noien;
 };
+
+int commultiprint(void *, const char *);
diff -r bb13a9fcac13 -r 919d40a05fce sys/dev/isa/commultiprint.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/isa/commultiprint.c       Tue Sep 14 17:19:34 2004 +0000
@@ -0,0 +1,18 @@
+/* $NetBSD: commultiprint.c,v 1.1 2004/09/14 17:19:34 drochner Exp $ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <machine/bus.h>
+#include <dev/isa/com_multi.h>
+
+int
+commultiprint(void *vca, const char *pnp)
+{
+       struct commulti_attach_args *ca = vca;
+
+       if (pnp)
+               aprint_normal("com at %s", pnp);
+       aprint_normal(" slave %d", ca->ca_slave);
+       return (UNCONF);
+}
diff -r bb13a9fcac13 -r 919d40a05fce sys/dev/isa/files.isa
--- a/sys/dev/isa/files.isa     Tue Sep 14 16:59:40 2004 +0000
+++ b/sys/dev/isa/files.isa     Tue Sep 14 17:19:34 2004 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.isa,v 1.134 2004/08/30 10:30:38 drochner Exp $
+#      $NetBSD: files.isa,v 1.135 2004/09/14 17:19:34 drochner Exp $
 #
 # Config file and device description for machine-independent ISA code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -25,6 +25,7 @@
 #
 
 define commulti {[slave = -1]}
+file   dev/isa/commultiprint.c         commulti
 
 # AST 4-port board
 device ast: commulti
diff -r bb13a9fcac13 -r 919d40a05fce sys/dev/isa/ioat66.c
--- a/sys/dev/isa/ioat66.c      Tue Sep 14 16:59:40 2004 +0000
+++ b/sys/dev/isa/ioat66.c      Tue Sep 14 17:19:34 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ioat66.c,v 1.7 2003/01/06 13:05:14 wiz Exp $   */
+/*     $NetBSD: ioat66.c,v 1.8 2004/09/14 17:19:34 drochner Exp $      */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ioat66.c,v 1.7 2003/01/06 13:05:14 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioat66.c,v 1.8 2004/09/14 17:19:34 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -71,7 +71,6 @@
 int ioat66probe __P((struct device *, struct cfdata *, void *));
 void ioat66attach __P((struct device *, struct device *, void *));
 int ioat66intr __P((void *));
-int ioat66print __P((void *, const char *));
 
 CFATTACH_DECL(ioat, sizeof(struct ioat_softc),
     ioat66probe, ioat66attach, NULL, NULL);
@@ -132,19 +131,6 @@
        return (rv);
 }
 
-int
-ioat66print(aux, pnp)
-       void *aux;
-       const char *pnp;
-{
-       struct commulti_attach_args *ca = aux;
-
-       if (pnp)
-               aprint_normal("com at %s", pnp);
-       aprint_normal(" slave %d", ca->ca_slave);
-       return (UNCONF);
-}
-
 void
 ioat66attach(parent, self, aux)
        struct device *parent, *self;
@@ -186,7 +172,7 @@
                ca.ca_iobase = ioatbases[i];
                ca.ca_noien = 0;
 
-               sc->sc_slaves[i] = config_found(self, &ca, ioat66print);
+               sc->sc_slaves[i] = config_found(self, &ca, commultiprint);
                if (sc->sc_slaves[i] != NULL)
                        sc->sc_alive |= 1 << i;
        }
diff -r bb13a9fcac13 -r 919d40a05fce sys/dev/isa/moxa_isa.c
--- a/sys/dev/isa/moxa_isa.c    Tue Sep 14 16:59:40 2004 +0000
+++ b/sys/dev/isa/moxa_isa.c    Tue Sep 14 17:19:34 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: moxa_isa.c,v 1.8 2003/10/27 07:14:25 chs Exp $ */
+/*     $NetBSD: moxa_isa.c,v 1.9 2004/09/14 17:19:34 drochner Exp $    */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: moxa_isa.c,v 1.8 2003/10/27 07:14:25 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: moxa_isa.c,v 1.9 2004/09/14 17:19:34 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -67,7 +67,6 @@
 int moxa_isaprobe __P((struct device *, struct cfdata *, void *));
 void moxa_isaattach __P((struct device *, struct device *, void *));
 int moxa_isaintr __P((void *));
-int moxa_isaprint __P((void *, const char *));
 
 CFATTACH_DECL(moxa_isa, sizeof(struct moxa_isa_softc),
     moxa_isaprobe, moxa_isaattach, NULL, NULL);
@@ -144,19 +143,6 @@
        return (rv);



Home | Main Index | Thread Index | Old Index