Source-Changes-HG archive

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

[src/trunk]: src/sys No functional change:



details:   https://anonhg.NetBSD.org/src/rev/e7f77dcbfcae
branches:  trunk
changeset: 450767:e7f77dcbfcae
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Apr 25 10:08:45 2019 +0000

description:
No functional change:
- Use __arraycount().
- u_int_{8,16,32}_t -> uint_{8,16,32}_t
- KNF.
- Tabify.
- Remove extra space.

diffstat:

 sys/arch/acorn32/eb7500atx/if_cs.c      |   52 +-
 sys/arch/acorn32/podulebus/if_ne_pbus.c |   94 ++--
 sys/arch/hppa/gsc/if_ie_gsc.c           |   54 +-
 sys/arch/macppc/dev/if_mc.c             |   54 +-
 sys/arch/sparc/dev/if_ie_obio.c         |   48 +-
 sys/arch/sparc/dev/if_le_obio.c         |   33 +-
 sys/arch/sun2/dev/if_ie_mbmem.c         |   82 ++--
 sys/arch/sun2/dev/if_ie_obio.c          |   62 +-
 sys/dev/ic/cs89x0.c                     |  516 +++++++++++++++----------------
 sys/dev/ic/rtl80x9.c                    |   33 +-
 sys/dev/ic/smc91cxx.c                   |  286 ++++++-----------
 sys/dev/isa/if_ef.c                     |   28 +-
 sys/dev/isa/if_ix.c                     |   34 +-
 sys/dev/pci/if_le_pci.c                 |   54 +-
 sys/dev/vme/if_ie_vme.c                 |  101 +++---
 15 files changed, 700 insertions(+), 831 deletions(-)

diffs (truncated from 4277 to 300 lines):

diff -r d0f5a40bd703 -r e7f77dcbfcae sys/arch/acorn32/eb7500atx/if_cs.c
--- a/sys/arch/acorn32/eb7500atx/if_cs.c        Thu Apr 25 09:03:54 2019 +0000
+++ b/sys/arch/acorn32/eb7500atx/if_cs.c        Thu Apr 25 10:08:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cs.c,v 1.10 2015/04/13 21:18:40 riastradh Exp $     */
+/*     $NetBSD: if_cs.c,v 1.11 2019/04/25 10:08:45 msaitoh Exp $       */
 
 /*
  * Copyright (c) 2004 Christopher Gilbert
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cs.c,v 1.10 2015/04/13 21:18:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cs.c,v 1.11 2019/04/25 10:08:45 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -86,14 +86,14 @@
  *
  * IRQ is mapped as:
  * CS8920 IRQ 3        INT5
- * 
+ *
  * It must be configured as the following:
  * The CS8920 PNP address should be configured for ISA base at 0x300
- * to achieve the default register mapping as specified. 
+ * to achieve the default register mapping as specified.
  * Note memory addresses are all have bit 23 tied high in hardware.
  * This only effects the value programmed into the CS8920 memory offset
- * registers. 
- * 
+ * registers.
+ *
  * Just to add to the fun the I/O registers are layed out as:
  * xxxxR1R0
  * xxxxR3R2
@@ -102,8 +102,8 @@
  * This works fine for 16bit accesses, but it makes access to single
  * register hard (which does happen on a reset, as we've got to toggle
  * the chip into 16bit mode)
- * 
- * Network DRQ is connected to DRQ5 
+ *
+ * Network DRQ is connected to DRQ5
  */
 
 /*
@@ -121,18 +121,18 @@
 
 /* Available media */
 int cs_rbus_media [] = {
-       IFM_ETHER|IFM_10_T|IFM_FDX,
-       IFM_ETHER|IFM_10_T
+       IFM_ETHER | IFM_10_T | IFM_FDX,
+       IFM_ETHER | IFM_10_T
 };
 
-int 
+int
 cs_rsbus_probe(device_t parent, cfdata_t cf, void *aux)
 {
-       /* for now it'll always attach */
+       /* For now it'll always attach */
        return 1;
 }
 
-void 
+void
 cs_rsbus_attach(device_t parent, device_t self, void *aux)
 {
        struct cs_softc *sc = device_private(self);
@@ -141,12 +141,12 @@
 
        sc->sc_dev = self;
 
-       /* member copy */
+       /* Member copy */
        cs_rsbus_bs_tag = *rs->sa_iot;
-       
-       /* registers are normally accessed in pairs, on a 4 byte aligned */
+
+       /* Registers are normally accessed in pairs, on a 4 byte aligned */
        cs_rsbus_bs_tag.bs_cookie = (void *) 1;
-       
+
        sc->sc_iot = sc->sc_memt = &cs_rsbus_bs_tag;
 
 #if 0  /* Do DMA later */
@@ -156,14 +156,12 @@
                isc->sc_drq = -1;
 #endif
 
-       /* device always interrupts on 3 but that routes to IRQ 5 */
+       /* Device always interrupts on 3 but that routes to IRQ 5 */
        sc->sc_irq = 3;
 
        printf("\n");
 
-       /*
-        * Map the device.
-        */
+       /* Map the device. */
        iobase = 0x03010600;
        if (bus_space_map(sc->sc_iot, iobase, CS8900_IOSIZE * 4,
            0, &sc->sc_ioh)) {
@@ -178,7 +176,7 @@
        } else {
                sc->sc_cfgflags |= CFGFLG_MEM_MODE | CFGFLG_USE_SA;
                sc->sc_pktpgaddr = 1<<23;
-               //(0x4000 >> 1)  |  (1<<23);
+               //(0x4000 >> 1)  |  (1<<23);
        }
 #endif
        sc->sc_ih = intr_claim(IRQ_INT5, IPL_NET, "cs", cs_intr, sc);
@@ -196,12 +194,12 @@
        sc->sc_cfgflags |= CFGFLG_PARSE_EEPROM;
        sc->sc_io_read_1 = cs_rbus_read_1;
 
-       /* 
+       /*
         * also provide media, otherwise it attempts to read the media from
         * the EEPROM, which again fails
         */
-       cs_attach(sc, NULL, cs_rbus_media, sizeof(cs_rbus_media) / sizeof(cs_rbus_media[0]),
-                       IFM_ETHER|IFM_10_T|IFM_FDX);
+       cs_attach(sc, NULL, cs_rbus_media, __arraycount(cs_rbus_media),
+           IFM_ETHER |IFM_10_T | IFM_FDX);
 }
 
 /*
@@ -212,14 +210,14 @@
 cs_rbus_read_1(struct cs_softc *sc, bus_size_t a)
 {
        bus_size_t offset;
-       /* 
+       /*
         * if it's an even address then just use the bus_space_read_1
         */
        if ((a & 1) == 0)
        {
                return bus_space_read_1(sc->sc_iot, sc->sc_ioh, a);
        }
-       /* 
+       /*
         * otherwise we've get to work out the aligned address and then add
         * one
         */
diff -r d0f5a40bd703 -r e7f77dcbfcae sys/arch/acorn32/podulebus/if_ne_pbus.c
--- a/sys/arch/acorn32/podulebus/if_ne_pbus.c   Thu Apr 25 09:03:54 2019 +0000
+++ b/sys/arch/acorn32/podulebus/if_ne_pbus.c   Thu Apr 25 10:08:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ne_pbus.c,v 1.18 2014/01/21 19:30:46 christos Exp $ */
+/*     $NetBSD: if_ne_pbus.c,v 1.19 2019/04/25 10:08:45 msaitoh Exp $  */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ne_pbus.c,v 1.18 2014/01/21 19:30:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ne_pbus.c,v 1.19 2019/04/25 10:08:45 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -211,16 +211,16 @@
 static int
 ne_pbus_probe(device_t parent, cfdata_t cf, void *aux)
 {
-       struct podule_attach_args *pa = (void *) aux;
+       struct podule_attach_args *pa = (void *)aux;
        int loop;
 
        /* Scan the list of known interfaces looking for a match */
        for (loop = 0; loop < sizeof(ne_clones) / sizeof(struct ne_clone);
            ++loop) {
                if (pa->pa_product == ne_clones[loop].product)
-                       return(1);
+                       return 1;
        }
-       return(0);
+       return 0;
 }
 
 /*
@@ -358,7 +358,7 @@
        if (ne->preattach)
                ne->preattach(npsc);
 
-       /* if the interface has media support initialise it */
+       /* If the interface has media support initialise it */
        if (ne->init_media) {
                dsc->sc_mediachange = ne->mediachange;
                dsc->sc_mediastatus = ne->mediastatus;
@@ -389,7 +389,7 @@
        case NE2000_TYPE_DL10019:
                aprint_normal("DL10019");
                break;
-        case NE2000_TYPE_DL10022:
+       case NE2000_TYPE_DL10022:
                aprint_normal("DL10022");
                break;
        default:
@@ -409,7 +409,7 @@
        if (npsc->sc_ih == NULL)
                panic("%s: Cannot install interrupt handler",
                   device_xname(self));
-       /* this feels wrong to do this here */
+       /* This feels wrong to do this here */
        npsc->sc_ih->ih_maskaddr = npsc->sc_podule->irq_addr;
        npsc->sc_ih->ih_maskbits = npsc->sc_podule->irq_mask;
 }
@@ -430,7 +430,7 @@
         */
 
        netslot_ea(buffer);
-       return(buffer);
+       return buffer;
 }
 
 /*
@@ -479,8 +479,8 @@
 /*
  * eh600_preattach()
  *
- * pre-initialise the AT/Lantic chipset so that the card probes and 
- * detects properly. 
+ * pre-initialise the AT/Lantic chipset so that the card probes and
+ * detects properly.
  */
 static void
 eh600_preattach(struct ne_pbus_softc *sc)
@@ -490,22 +490,22 @@
        struct dp8390_softc *dsc = &nsc->sc_dp8390;
        bus_space_tag_t nict = dsc->sc_regt;
        bus_space_handle_t nich = dsc->sc_regh;
-       
-       /* initialise EH600 config register */
+
+       /* Initialise EH600 config register */
        bus_space_read_1(nict, nich, DP83905_MCRA);
        bus_space_write_1(nict, nich, DP83905_MCRA, DP83905_MCRA_INT3);
 
-       /* enable interrupts for the card */
-       tmp = bus_space_read_1(&sc->sc_tag,sc->sc_extrah,0); 
+       /* Enable interrupts for the card */
+       tmp = bus_space_read_1(&sc->sc_tag,sc->sc_extrah,0);
        tmp |= EH_INTR_MASK;
-       bus_space_write_1(&sc->sc_tag,sc->sc_extrah,0,tmp); 
+       bus_space_write_1(&sc->sc_tag,sc->sc_extrah,0,tmp);
 }
 
 /*
  * eh600_postattach()
  *
- * Etherlan 600 has 32k of buffer memory as it runs the AT/Lantic 
- * DP8390 clone in IO non-compatible mode. We need to adjust the memory 
+ * Etherlan 600 has 32k of buffer memory as it runs the AT/Lantic
+ * DP8390 clone in IO non-compatible mode. We need to adjust the memory
  * description set up by dp8390.c and ne2000.c to reflect this.
  */
 static void
@@ -513,24 +513,25 @@
 {
        struct ne2000_softc *nsc = &sc->sc_ne2000;
        struct dp8390_softc *dsc = &nsc->sc_dp8390;
-       /* first page is mapped to the PROM. so start at 2nd page */
+
+       /* First page is mapped to the PROM. so start at 2nd page */
        dsc->mem_start = EH600_MEM_START;
        dsc->mem_size = EH600_MEM_END - EH600_MEM_START;
        dsc->mem_end = EH600_MEM_END;
        dsc->txb_cnt = 3; /* >16k of ram setup 3 tx buffers */
-       /* recompute the mem ring (taken straight from the ne2000 init code) */
-       dsc->mem_ring = 
-               dsc->mem_start + 
+       /* Recompute the mem ring (taken straight from the ne2000 init code) */
+       dsc->mem_ring =
+               dsc->mem_start +
                (((dsc->txb_cnt + 1) * ED_TXBUF_SIZE ) <<
                 ED_PAGE_SHIFT);
 
-       /* recompute the dp8390 register values. (from dp8390 init code) */
+       /* Recompute the dp8390 register values. (from dp8390 init code) */
        dsc->tx_page_start = dsc->mem_start >> ED_PAGE_SHIFT;
 
-       dsc->rec_page_start = dsc->tx_page_start + 
+       dsc->rec_page_start = dsc->tx_page_start +
                (dsc->txb_cnt + 1) * ED_TXBUF_SIZE;
 
-       dsc->rec_page_stop = dsc->tx_page_start + 
+       dsc->rec_page_stop = dsc->tx_page_start +
                (dsc->mem_size >> ED_PAGE_SHIFT);
        aprint_normal_dev(dsc->sc_dev, "32KB buffer memory\n");
 }
@@ -540,13 +541,12 @@
 void eh600_init_media(struct dp8390_softc *sc)
 {
        static int eh600_media[] = {



Home | Main Index | Thread Index | Old Index