From 2f25e6cf413bd31260c87a13ce8128a771e3fcd0 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Tue, 22 Sep 2009 13:20:36 +0000 Subject: [PATCH] - make local functions/variables static - use __arraycount() --- sys/dev/isapnp/aic_isapnp.c | 8 ++++---- sys/dev/pcmcia/aic_pcmcia.c | 19 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/sys/dev/isapnp/aic_isapnp.c b/sys/dev/isapnp/aic_isapnp.c index 3070eb93f94f..a4742e51ffa2 100644 --- a/sys/dev/isapnp/aic_isapnp.c +++ b/sys/dev/isapnp/aic_isapnp.c @@ -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 -__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 #include @@ -57,8 +57,8 @@ struct aic_isapnp_softc { 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 --git a/sys/dev/pcmcia/aic_pcmcia.c b/sys/dev/pcmcia/aic_pcmcia.c index 0a5d41497719..90e09c3db33f 100644 --- a/sys/dev/pcmcia/aic_pcmcia.c +++ b/sys/dev/pcmcia/aic_pcmcia.c @@ -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 -__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 #include @@ -62,16 +62,16 @@ struct aic_pcmcia_softc { #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 @@ const struct pcmcia_product aic_pcmcia_products[] = { { 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)