Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/isa KNF. No functional change.



details:   https://anonhg.NetBSD.org/src/rev/19bccdfaefa6
branches:  trunk
changeset: 998151:19bccdfaefa6
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Apr 09 06:15:21 2019 +0000

description:
KNF. No functional change.

diffstat:

 sys/dev/isa/if_ix.c |  284 +++++++++++++++++++++++++--------------------------
 1 files changed, 137 insertions(+), 147 deletions(-)

diffs (truncated from 704 to 300 lines):

diff -r 6a954b74f170 -r 19bccdfaefa6 sys/dev/isa/if_ix.c
--- a/sys/dev/isa/if_ix.c       Tue Apr 09 06:00:08 2019 +0000
+++ b/sys/dev/isa/if_ix.c       Tue Apr 09 06:15:21 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ix.c,v 1.35 2016/07/14 04:19:27 msaitoh Exp $       */
+/*     $NetBSD: if_ix.c,v 1.36 2019/04/09 06:15:21 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.35 2016/07/14 04:19:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ix.c,v 1.36 2019/04/09 06:15:21 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -63,7 +63,7 @@
 #define DPRINTF(x)
 #endif
 
-int ix_media[] = {
+static int ix_media[] = {
        IFM_ETHER | IFM_10_5,
        IFM_ETHER | IFM_10_2,
        IFM_ETHER | IFM_10_T,
@@ -76,8 +76,8 @@
        bus_space_tag_t sc_regt;        /* space tag for registers */
        bus_space_handle_t sc_regh;     /* space handle for registers */
 
-       u_int8_t        use_pio;        /* use PIO rather than shared mem */
-       u_int16_t       irq_encoded;    /* encoded IRQ */
+       uint8_t         use_pio;        /* use PIO rather than shared mem */
+       uint16_t        irq_encoded;    /* encoded IRQ */
        void            *sc_ih;         /* interrupt handle */
 };
 
@@ -90,21 +90,21 @@
 
 static void    ix_bus_barrier(struct ie_softc *, int, int, int);
 
-static u_int16_t ix_read_16(struct ie_softc *, int);
-static void    ix_write_16(struct ie_softc *, int, u_int16_t);
+static uint16_t ix_read_16(struct ie_softc *, int);
+static void    ix_write_16(struct ie_softc *, int, uint16_t);
 static void    ix_write_24(struct ie_softc *, int, int);
-static void    ix_zeromem (struct ie_softc *, int, int);
+static void    ix_zeromem(struct ie_softc *, int, int);
 
 static void    ix_mediastatus(struct ie_softc *, struct ifmediareq *);
 
-static u_int16_t ix_read_eeprom(bus_space_tag_t, bus_space_handle_t, int);
+static uint16_t ix_read_eeprom(bus_space_tag_t, bus_space_handle_t, int);
 static void    ix_eeprom_outbits(bus_space_tag_t, bus_space_handle_t, int,
     int);
-static int     ix_eeprom_inbits (bus_space_tag_t, bus_space_handle_t);
-static void    ix_eeprom_clock  (bus_space_tag_t, bus_space_handle_t, int);
+static int     ix_eeprom_inbits(bus_space_tag_t, bus_space_handle_t);
+static void    ix_eeprom_clock(bus_space_tag_t, bus_space_handle_t, int);
 
-int ix_match(device_t, cfdata_t, void *);
-void ix_attach(device_t, device_t, void *);
+static int     ix_match(device_t, cfdata_t, void *);
+static void    ix_attach(device_t, device_t, void *);
 
 /*
  * EtherExpress/16 support routines
@@ -112,12 +112,12 @@
 static void
 ix_reset(struct ie_softc *sc, int why)
 {
-       struct ix_softc* isc = (struct ix_softc *) sc;
+       struct ix_softc *isc = (struct ix_softc *)sc;
 
        switch (why) {
        case CHIP_PROBE:
                bus_space_write_1(isc->sc_regt, isc->sc_regh, IX_ECTRL,
-                                 IX_RESET_586);
+                   IX_RESET_586);
                delay(100);
                bus_space_write_1(isc->sc_regt, isc->sc_regh, IX_ECTRL, 0);
                delay(100);
@@ -125,17 +125,18 @@
 
        case CARD_RESET:
                break;
-    }
+       }
 }
 
 static void
 ix_atten(struct ie_softc *sc, int why)
 {
-       struct ix_softc* isc = (struct ix_softc *) sc;
+       struct ix_softc *isc = (struct ix_softc *)sc;
+
        bus_space_write_1(isc->sc_regt, isc->sc_regh, IX_ATTN, 0);
 }
 
-static u_int16_t
+static uint16_t
 ix_read_eeprom(bus_space_tag_t iot, bus_space_handle_t ioh, int location)
 {
        int ectrl, edata;
@@ -153,7 +154,7 @@
        bus_space_write_1(iot, ioh, IX_ECTRL, ectrl);
        ix_eeprom_clock(iot, ioh, 1);
        ix_eeprom_clock(iot, ioh, 0);
-       return (edata);
+       return edata;
 }
 
 static void
@@ -195,7 +196,7 @@
                }
                ix_eeprom_clock(iot, ioh, 0);
        }
-       return (edata);
+       return edata;
 }
 
 static void
@@ -215,7 +216,7 @@
 static int
 ix_intrhook(struct ie_softc *sc, int where)
 {
-       struct ix_softc* isc = (struct ix_softc *) sc;
+       struct ix_softc *isc = (struct ix_softc *)sc;
 
        switch (where) {
        case INTR_ENTER:
@@ -239,21 +240,20 @@
 ix_copyin(struct ie_softc *sc, void *dst, int offset, size_t size)
 {
        int i, dribble;
-       u_int8_t* bptr = dst;
-       u_int16_t* wptr = dst;
-       struct ix_softc* isc = (struct ix_softc *) sc;
+       uint8_t *bptr = dst;
+       uint16_t *wptr = dst;
+       struct ix_softc *isc = (struct ix_softc *)sc;
 
        if (isc->use_pio) {
                /* Reset read pointer to the specified offset */
                bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2,
-                                                 BUS_SPACE_BARRIER_READ);
+                   BUS_SPACE_BARRIER_READ);
                bus_space_write_2(sc->bt, sc->bh, IX_READPTR, offset);
                bus_space_barrier(sc->bt, sc->bh, IX_READPTR, 2,
-                                                 BUS_SPACE_BARRIER_WRITE);
-       } else {
+                   BUS_SPACE_BARRIER_WRITE);
+       } else
                bus_space_barrier(sc->bt, sc->bh, offset, size,
-                         BUS_SPACE_BARRIER_READ);
-       }
+                   BUS_SPACE_BARRIER_READ);
 
        if (offset % 2) {
                if (isc->use_pio)
@@ -264,17 +264,16 @@
        }
 
        dribble = size % 2;
-       wptr = (u_int16_t*) bptr;
+       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++;
                }
-       } else {
+       } else
                bus_space_read_region_2(sc->bt, sc->bh, offset,
-                                       (u_int16_t *) bptr, size / 2);
-       }
+                   (uint16_t *)bptr, size / 2);
 
        if (dribble) {
                bptr += size - 1;
@@ -293,9 +292,9 @@
        int i, dribble;
        int osize = size;
        int ooffset = offset;
-       const u_int8_t* bptr = src;
-       const u_int16_t* wptr = src;
-       struct ix_softc* isc = (struct ix_softc *) sc;
+       const uint8_t *bptr = src;
+       const uint16_t *wptr = src;
+       struct ix_softc *isc = (struct ix_softc *)sc;
 
        if (isc->use_pio) {
                /* Reset write pointer to the specified offset */
@@ -313,17 +312,16 @@
        }
 
        dribble = size % 2;
-       wptr = (const u_int16_t*) bptr;
+       wptr = (const uint16_t*)bptr;
 
        if (isc->use_pio) {
-               for(i = 0; i < size / 2; i++) {
+               for (i = 0; i < size / 2; i++) {
                        bus_space_write_2(sc->bt, sc->bh, IX_DATAPORT, *wptr);
                        wptr++;
                }
-       } else {
+       } else
                bus_space_write_region_2(sc->bt, sc->bh, offset,
-                   (const u_int16_t *)bptr, size / 2);
-       }
+                   (const uint16_t *)bptr, size / 2);
 
        if (dribble) {
                bptr += size - 1;
@@ -337,16 +335,16 @@
 
        if (isc->use_pio)
                bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2,
-                                                 BUS_SPACE_BARRIER_WRITE);
+                   BUS_SPACE_BARRIER_WRITE);
        else
                bus_space_barrier(sc->bt, sc->bh, ooffset, osize,
-                         BUS_SPACE_BARRIER_WRITE);
+                   BUS_SPACE_BARRIER_WRITE);
 }
 
 static void
 ix_bus_barrier(struct ie_softc *sc, int offset, int length, int flags)
 {
-       struct ix_softc* isc = (struct ix_softc *) sc;
+       struct ix_softc *isc = (struct ix_softc *)sc;
 
        if (isc->use_pio)
                bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2, flags);
@@ -354,73 +352,73 @@
                bus_space_barrier(sc->bt, sc->bh, offset, length, flags);
 }
 
-static u_int16_t
-ix_read_16 (struct ie_softc *sc, int offset)
+static uint16_t
+ix_read_16(struct ie_softc *sc, int offset)
 {
-       struct ix_softc* isc = (struct ix_softc *) sc;
+       struct ix_softc *isc = (struct ix_softc *)sc;
 
        if (isc->use_pio) {
                bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2,
-                                                 BUS_SPACE_BARRIER_READ);
+                   BUS_SPACE_BARRIER_READ);
 
                /* Reset read pointer to the specified offset */
                bus_space_write_2(sc->bt, sc->bh, IX_READPTR, offset);
                bus_space_barrier(sc->bt, sc->bh, IX_READPTR, 2,
-                                                 BUS_SPACE_BARRIER_WRITE);
+                   BUS_SPACE_BARRIER_WRITE);
 
                return bus_space_read_2(sc->bt, sc->bh, IX_DATAPORT);
        } else {
                bus_space_barrier(sc->bt, sc->bh, offset, 2,
-                                                 BUS_SPACE_BARRIER_READ);
-        return bus_space_read_2(sc->bt, sc->bh, offset);
+                   BUS_SPACE_BARRIER_READ);
+               return bus_space_read_2(sc->bt, sc->bh, offset);
        }
 }
 
 static void
-ix_write_16 (struct ie_softc *sc, int offset, u_int16_t value)
+ix_write_16(struct ie_softc *sc, int offset, uint16_t value)
 {
-       struct ix_softc* isc = (struct ix_softc *) sc;
+       struct ix_softc *isc = (struct ix_softc *)sc;
 
        if (isc->use_pio) {
                /* Reset write pointer to the specified offset */
                bus_space_write_2(sc->bt, sc->bh, IX_WRITEPTR, offset);
                bus_space_barrier(sc->bt, sc->bh, IX_WRITEPTR, 2,
-                                                 BUS_SPACE_BARRIER_WRITE);
+                   BUS_SPACE_BARRIER_WRITE);
 
                bus_space_write_2(sc->bt, sc->bh, IX_DATAPORT, value);
                bus_space_barrier(sc->bt, sc->bh, IX_DATAPORT, 2,
-                                                 BUS_SPACE_BARRIER_WRITE);
+                   BUS_SPACE_BARRIER_WRITE);
        } else {
                bus_space_write_2(sc->bt, sc->bh, offset, value);
                bus_space_barrier(sc->bt, sc->bh, offset, 2,
-                                                 BUS_SPACE_BARRIER_WRITE);
+                   BUS_SPACE_BARRIER_WRITE);
        }
 }
 
 static void
 ix_write_24 (struct ie_softc *sc, int offset, int addr)
 {



Home | Main Index | Thread Index | Old Index