summaryrefslogtreecommitdiff
path: root/sys/dev/isa
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2019-04-25 10:08:45 +0000
committermsaitoh <msaitoh@NetBSD.org>2019-04-25 10:08:45 +0000
commitea20c19bec2534495931321f7846abd1ca0146a2 (patch)
treea4625f8a1ec247d82c7d1b64bb177785acb12ddf /sys/dev/isa
parentc518611761c3db696659d546fcbad5d18967fe52 (diff)
No functional change:
- Use __arraycount(). - u_int_{8,16,32}_t -> uint_{8,16,32}_t - KNF. - Tabify. - Remove extra space.
Diffstat (limited to 'sys/dev/isa')
-rw-r--r--sys/dev/isa/if_ef.c28
-rw-r--r--sys/dev/isa/if_ix.c34
2 files changed, 31 insertions, 31 deletions
diff --git a/sys/dev/isa/if_ef.c b/sys/dev/isa/if_ef.c
index 6a72b70aeb1..0ebe63e61eb 100644
--- a/sys/dev/isa/if_ef.c
+++ b/sys/dev/isa/if_ef.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ef.c,v 1.33 2019/04/09 06:00:08 msaitoh Exp $ */
+/* $NetBSD: if_ef.c,v 1.34 2019/04/25 10:08:46 msaitoh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ef.c,v 1.33 2019/04/09 06:00:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ef.c,v 1.34 2019/04/25 10:08:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -80,18 +80,18 @@ static int ef_media[] = {
IFM_ETHER | IFM_10_5,
IFM_ETHER | IFM_10_2,
};
-#define NEF_MEDIA (sizeof(ef_media) / sizeof(ef_media[0]))
+#define NEF_MEDIA __arraycount(ef_media)
static int eftp_media[] = {
IFM_ETHER | IFM_10_T,
};
-#define NEFTP_MEDIA (sizeof(eftp_media) / sizeof(eftp_media[0]))
+#define NEFTP_MEDIA __arraycount(eftp_media)
/* Routines required by the MI i82586 driver API */
-static void ef_reset(struct ie_softc *, int);
-static void ef_hwinit(struct ie_softc *);
-static void ef_atten(struct ie_softc *, int);
-static int ef_intrhook(struct ie_softc *, int);
+static void ef_reset(struct ie_softc *, int);
+static void ef_hwinit(struct ie_softc *);
+static void ef_atten(struct ie_softc *, int);
+static int ef_intrhook(struct ie_softc *, int);
static void ef_copyin(struct ie_softc *, void *, int, size_t);
static void ef_copyout(struct ie_softc *, const void *, int, size_t);
@@ -103,7 +103,7 @@ static void ef_write_24(struct ie_softc *, int, int);
static void ef_mediastatus(struct ie_softc *, struct ifmediareq *);
/* Local routines */
-static int ef_port_check(bus_space_tag_t, bus_space_handle_t);
+static int ef_port_check(bus_space_tag_t, bus_space_handle_t);
static int ef_match(device_t, cfdata_t, void *);
static void ef_attach(device_t, device_t, void *);
@@ -117,7 +117,7 @@ static void ef_attach(device_t, device_t, void *);
* which will unique per ISA bus.
*/
-#define MAXCARDS_PER_ISABUS 8 /* If you have more than 8, you lose */
+#define MAXCARDS_PER_ISABUS 8 /* If you have more than 8, you lose */
struct ef_isabus {
LIST_ENTRY(ef_isabus) isa_link;
@@ -312,10 +312,10 @@ ef_write_24(struct ie_softc *sc, int offset, int addr)
static void
ef_mediastatus(struct ie_softc *sc, struct ifmediareq *ifmr)
{
- struct ifmedia *ifm = &sc->sc_media;
+ struct ifmedia *ifm = &sc->sc_media;
- /* The currently selected media is always the active media. */
- ifmr->ifm_active = ifm->ifm_cur->ifm_media;
+ /* The currently selected media is always the active media. */
+ ifmr->ifm_active = ifm->ifm_cur->ifm_media;
}
static int
@@ -645,7 +645,7 @@ static int
ef_port_check(bus_space_tag_t iot, bus_space_handle_t ioh)
{
int i;
- u_char ch;
+ u_char ch;
const u_char *signature = EF_SIGNATURE;
for (i = 0; i < strlen(signature); i++) {
diff --git a/sys/dev/isa/if_ix.c b/sys/dev/isa/if_ix.c
index dde99b1f8dd..88131f0e964 100644
--- a/sys/dev/isa/if_ix.c
+++ b/sys/dev/isa/if_ix.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ix.c,v 1.37 2019/04/09 06:19:34 msaitoh Exp $ */
+/* $NetBSD: if_ix.c,v 1.38 2019/04/25 10:08:46 msaitoh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ix.c,v 1.37 2019/04/09 06:19:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ix.c,v 1.38 2019/04/25 10:08:46 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -68,7 +68,7 @@ static int ix_media[] = {
IFM_ETHER | IFM_10_2,
IFM_ETHER | IFM_10_T,
};
-#define NIX_MEDIA (sizeof(ix_media) / sizeof(ix_media[0]))
+#define NIX_MEDIA __arraycount(ix_media)
struct ix_softc {
struct ie_softc sc_ie;
@@ -81,12 +81,12 @@ struct ix_softc {
void *sc_ih; /* interrupt handle */
};
-static void ix_reset(struct ie_softc *, int);
-static void ix_atten(struct ie_softc *, int);
-static int ix_intrhook(struct ie_softc *, int);
+static void ix_reset(struct ie_softc *, int);
+static void ix_atten(struct ie_softc *, int);
+static int ix_intrhook(struct ie_softc *, int);
-static void ix_copyin(struct ie_softc *, void *, int, size_t);
-static void ix_copyout(struct ie_softc *, const void *, int, size_t);
+static void ix_copyin(struct ie_softc *, void *, int, size_t);
+static void ix_copyout(struct ie_softc *, const void *, int, size_t);
static void ix_bus_barrier(struct ie_softc *, int, int, int);
@@ -220,15 +220,15 @@ ix_intrhook(struct ie_softc *sc, int where)
switch (where) {
case INTR_ENTER:
- /* entering ISR: disable card interrupts */
+ /* Entering ISR: disable card interrupts */
bus_space_write_1(isc->sc_regt, isc->sc_regh,
IX_IRQ, isc->irq_encoded);
break;
case INTR_EXIT:
- /* exiting ISR: re-enable card interrupts */
+ /* Exiting ISR: re-enable card interrupts */
bus_space_write_1(isc->sc_regt, isc->sc_regh, IX_IRQ,
- isc->irq_encoded | IX_IRQ_ENABLE);
+ isc->irq_encoded | IX_IRQ_ENABLE);
break;
}
@@ -267,7 +267,7 @@ ix_copyin(struct ie_softc *sc, void *dst, int offset, size_t size)
wptr = (uint16_t*)bptr;
if (isc->use_pio) {
- for (i = 0; i < size / 2; i++) {
+ for (i = 0; i < size / 2; i++) {
*wptr = bus_space_read_2(sc->bt, sc->bh, IX_DATAPORT);
wptr++;
}
@@ -416,7 +416,7 @@ ix_write_24 (struct ie_softc *sc, int offset, int addr)
bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2,
BUS_SPACE_BARRIER_WRITE);
} else {
- bus_space_write_4(sc->bt, sc->bh, offset, val);
+ bus_space_write_4(sc->bt, sc->bh, offset, val);
bus_space_barrier(sc->bt, sc->bh, offset, 4,
BUS_SPACE_BARRIER_WRITE);
}
@@ -440,7 +440,7 @@ ix_zeromem(struct ie_softc *sc, int offset, int count)
count--;
}
- dribble = count % 2;
+ dribble = count % 2;
for (i = 0; i < count / 2; i++)
bus_space_write_2(sc->bt, sc->bh, IX_DATAPORT, 0);
@@ -459,10 +459,10 @@ ix_zeromem(struct ie_softc *sc, int offset, int count)
static void
ix_mediastatus(struct ie_softc *sc, struct ifmediareq *ifmr)
{
- struct ifmedia *ifm = &sc->sc_media;
+ struct ifmedia *ifm = &sc->sc_media;
- /* The currently selected media is always the active media. */
- ifmr->ifm_active = ifm->ifm_cur->ifm_media;
+ /* The currently selected media is always the active media. */
+ ifmr->ifm_active = ifm->ifm_cur->ifm_media;
}
int