Source-Changes-HG archive

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

[src/trunk]: src/sys/dev - make local functions/variables static



details:   https://anonhg.NetBSD.org/src/rev/00ace7e54ad7
branches:  trunk
changeset: 747586:00ace7e54ad7
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Tue Sep 22 13:20:36 2009 +0000

description:
- make local functions/variables static
- use __arraycount()

diffstat:

 sys/dev/isapnp/aic_isapnp.c |   8 ++++----
 sys/dev/pcmcia/aic_pcmcia.c |  19 +++++++++----------
 2 files changed, 13 insertions(+), 14 deletions(-)

diffs (80 lines):

diff -r c459b3defea1 -r 00ace7e54ad7 sys/dev/isapnp/aic_isapnp.c
--- a/sys/dev/isapnp/aic_isapnp.c       Tue Sep 22 13:18:28 2009 +0000
+++ b/sys/dev/isapnp/aic_isapnp.c       Tue Sep 22 13:20:36 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic_isapnp.c,v 1.20 2009/09/22 12:56:06 tsutsui Exp $  */
+/*     $NetBSD: aic_isapnp.c,v 1.21 2009/09/22 13:20:36 tsutsui Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic_isapnp.c,v 1.20 2009/09/22 12:56:06 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic_isapnp.c,v 1.21 2009/09/22 13:20:36 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -57,8 +57,8 @@
        void    *sc_ih;                 /* interrupt handler */
 };
 
-int    aic_isapnp_match(device_t, cfdata_t, void *);
-void   aic_isapnp_attach(device_t, device_t, void *);
+static int     aic_isapnp_match(device_t, cfdata_t, void *);
+static void    aic_isapnp_attach(device_t, device_t, void *);
 
 CFATTACH_DECL_NEW(aic_isapnp, sizeof(struct aic_isapnp_softc),
     aic_isapnp_match, aic_isapnp_attach, NULL, NULL);
diff -r c459b3defea1 -r 00ace7e54ad7 sys/dev/pcmcia/aic_pcmcia.c
--- a/sys/dev/pcmcia/aic_pcmcia.c       Tue Sep 22 13:18:28 2009 +0000
+++ b/sys/dev/pcmcia/aic_pcmcia.c       Tue Sep 22 13:20:36 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic_pcmcia.c,v 1.41 2009/09/22 12:56:06 tsutsui Exp $  */
+/*     $NetBSD: aic_pcmcia.c,v 1.42 2009/09/22 13:20:36 tsutsui Exp $  */
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.41 2009/09/22 12:56:06 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.42 2009/09/22 13:20:36 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -62,16 +62,16 @@
 #define        AIC_PCMCIA_ATTACHED     3
 };
 
-int    aic_pcmcia_match(device_t, cfdata_t, void *);
-int    aic_pcmcia_validate_config(struct pcmcia_config_entry *);
-void   aic_pcmcia_attach(device_t, device_t, void *);
-int    aic_pcmcia_detach(device_t, int);
-int    aic_pcmcia_enable(device_t, int);
+static int     aic_pcmcia_match(device_t, cfdata_t, void *);
+static int     aic_pcmcia_validate_config(struct pcmcia_config_entry *);
+static void    aic_pcmcia_attach(device_t, device_t, void *);
+static int     aic_pcmcia_detach(device_t, int);
+static int     aic_pcmcia_enable(device_t, int);
 
 CFATTACH_DECL_NEW(aic_pcmcia, sizeof(struct aic_pcmcia_softc),
     aic_pcmcia_match, aic_pcmcia_attach, aic_pcmcia_detach, aic_activate);
 
-const struct pcmcia_product aic_pcmcia_products[] = {
+static const struct pcmcia_product aic_pcmcia_products[] = {
        { PCMCIA_VENDOR_ADAPTEC, PCMCIA_PRODUCT_ADAPTEC_APA1460,
          PCMCIA_CIS_INVALID },
 
@@ -81,8 +81,7 @@
        { PCMCIA_VENDOR_NEWMEDIA, PCMCIA_PRODUCT_NEWMEDIA_BUSTOASTER,
          PCMCIA_CIS_INVALID },
 };
-const size_t aic_pcmcia_nproducts =
-    sizeof(aic_pcmcia_products) / sizeof(aic_pcmcia_products[0]);
+static const size_t aic_pcmcia_nproducts = __arraycount(aic_pcmcia_products);
 
 int
 aic_pcmcia_match(device_t parent, cfdata_t match, void *aux)



Home | Main Index | Thread Index | Old Index