Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/77f48d716ce3
branches:  trunk
changeset: 998157:77f48d716ce3
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Apr 09 13:25:07 2019 +0000

description:
KNF. No functional change.

diffstat:

 sys/dev/ic/i82596.c |  83 ++++++++++++++++++++++++++--------------------------
 1 files changed, 41 insertions(+), 42 deletions(-)

diffs (263 lines):

diff -r c3531b339b4f -r 77f48d716ce3 sys/dev/ic/i82596.c
--- a/sys/dev/ic/i82596.c       Tue Apr 09 11:28:45 2019 +0000
+++ b/sys/dev/ic/i82596.c       Tue Apr 09 13:25:07 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i82596.c,v 1.38 2018/06/26 06:48:00 msaitoh Exp $ */
+/* $NetBSD: i82596.c,v 1.39 2019/04/09 13:25:07 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2003 Jochen Kunz.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.38 2018/06/26 06:48:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.39 2019/04/09 13:25:07 msaitoh Exp $");
 
 /* autoconfig and device stuff */
 #include <sys/param.h>
@@ -214,7 +214,7 @@
        for (;;) {
                rfd = SC_RFD(sc, sc->sc_rx_done);
                IEE_RFDSYNC(sc, sc->sc_rx_done,
-                   BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
+                   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
                status = rfd->rfd_status;
                if ((status & IEE_RFD_C) == 0) {
                        IEE_RFDSYNC(sc, sc->sc_rx_done, BUS_DMASYNC_PREREAD);
@@ -222,20 +222,20 @@
                }
                rfd->rfd_status = 0;
                IEE_RFDSYNC(sc, sc->sc_rx_done,
-                   BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+                   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 
                /* At least one packet was received. */
                rx_map = sc->sc_rx_map[sc->sc_rx_done];
                rx_mbuf = sc->sc_rx_mbuf[sc->sc_rx_done];
                IEE_RBDSYNC(sc, (sc->sc_rx_done + IEE_NRFD - 1) % IEE_NRFD,
-                   BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
+                   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
                SC_RBD(sc, (sc->sc_rx_done + IEE_NRFD - 1) % IEE_NRFD)->rbd_size
                    &= ~IEE_RBD_EL;
                IEE_RBDSYNC(sc, (sc->sc_rx_done + IEE_NRFD - 1) % IEE_NRFD,
-                   BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+                   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
                rbd = SC_RBD(sc, sc->sc_rx_done);
                IEE_RBDSYNC(sc, sc->sc_rx_done,
-                   BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
+                   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
                count = rbd->rbd_count;
                if ((status & IEE_RFD_OK) == 0
                    || (count & IEE_RBD_EOF) == 0
@@ -244,7 +244,7 @@
                        rbd->rbd_count = 0;
                        rbd->rbd_size = IEE_RBD_EL | rx_map->dm_segs[0].ds_len;
                        IEE_RBDSYNC(sc, sc->sc_rx_done,
-                           BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+                           BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
                        printf("%s: iee_intr: receive error %d, rfd_status="
                            "0x%.4x, rfd_count=0x%.4x\n",
                            device_xname(sc->sc_dev),
@@ -286,7 +286,7 @@
                rbd->rbd_size = IEE_RBD_EL | rx_map->dm_segs[0].ds_len;
                rbd->rbd_rb_addr = IEE_SWAPA32(rx_map->dm_segs[0].ds_addr);
                IEE_RBDSYNC(sc, sc->sc_rx_done,
-                   BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+                   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
                sc->sc_rx_done = (sc->sc_rx_done + 1) % IEE_NRFD;
        }
        if ((scb_status & IEE_SCB_RUS) == IEE_SCB_RUS_NR1
@@ -313,7 +313,7 @@
                sc->sc_rx_done = 0;
                bus_dmamap_sync(sc->sc_dmat, sc->sc_shmem_map, sc->sc_rfd_off,
                    sc->sc_rfd_sz * IEE_NRFD + sc->sc_rbd_sz * IEE_NRFD,
-                   BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+                   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
                (sc->sc_iee_cmd)(sc, IEE_SCB_RUC_ST);
                printf("%s: iee_intr: receive ring buffer overrun\n",
                    device_xname(sc->sc_dev));
@@ -321,7 +321,7 @@
 
        if (sc->sc_next_cb != 0) {
                IEE_CBSYNC(sc, sc->sc_next_cb - 1,
-                   BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
+                   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
                status = SC_CB(sc, sc->sc_next_cb - 1)->cb_status;
                IEE_CBSYNC(sc, sc->sc_next_cb - 1,
                    BUS_DMASYNC_PREREAD);
@@ -336,7 +336,7 @@
                                        bus_dmamap_unload(sc->sc_dmat,
                                            sc->sc_tx_map[n]);
                                        IEE_CBSYNC(sc, n,
-                                           BUS_DMASYNC_POSTREAD|
+                                           BUS_DMASYNC_POSTREAD |
                                            BUS_DMASYNC_POSTWRITE);
                                        status = SC_CB(sc, n)->cb_status;
                                        IEE_CBSYNC(sc, n,
@@ -360,8 +360,8 @@
                                /*
                                 * Check if a CMD failed, but ignore TX errors.
                                 */
-                               IEE_CBSYNC(sc, n,
-                                   BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
+                               IEE_CBSYNC(sc, n, BUS_DMASYNC_POSTREAD |
+                                   BUS_DMASYNC_POSTWRITE);
                                cmd = SC_CB(sc, n)->cb_cmd;
                                status = SC_CB(sc, n)->cb_status;
                                IEE_CBSYNC(sc, n, BUS_DMASYNC_PREREAD);
@@ -393,8 +393,8 @@
        }
        if (IEE_SWAP32(SC_SCB(sc)->scb_align_err) != sc->sc_align_err) {
                sc->sc_align_err = IEE_SWAP32(SC_SCB(sc)->scb_align_err);
-               printf("%s: iee_intr: align_err=%d\n", device_xname(sc->sc_dev),
-                   sc->sc_align_err);
+               printf("%s: iee_intr: align_err=%d\n",
+                   device_xname(sc->sc_dev), sc->sc_align_err);
        }
        if (IEE_SWAP32(SC_SCB(sc)->scb_resource_err) != sc->sc_resource_err) {
                sc->sc_resource_err = IEE_SWAP32(SC_SCB(sc)->scb_resource_err);
@@ -552,7 +552,7 @@
        cb->cb_link_addr = IEE_SWAPA32(IEE_PHYS_SHMEM(sc->sc_cb_off +
            sc->sc_cb_sz * (sc->sc_next_cb + 1)));
        IEE_CBSYNC(sc, sc->sc_next_cb,
-           BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+           BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
        sc->sc_next_cb++;
        ifp->if_timer = 5;
 }
@@ -624,12 +624,16 @@
        }
        memset(sc->sc_shmem_addr, 0, sc->sc_shmem_sz);
 
-       /* Set pointer to Intermediate System Configuration Pointer. */
-       /* Phys. addr. in big endian order. (Big endian as defined by Intel.) */
+       /*
+        * Set pointer to Intermediate System Configuration Pointer.
+        * Phys. addr. in big endian order. (Big endian as defined by Intel.)
+        */
        SC_SCP(sc)->scp_iscp_addr = IEE_SWAP32(IEE_PHYS_SHMEM(sc->sc_iscp_off));
        SC_SCP(sc)->scp_sysbus = sc->sc_sysbus;
-       /* Set pointer to System Control Block. */
-       /* Phys. addr. in big endian order. (Big endian as defined by Intel.) */
+       /*
+        * Set pointer to System Control Block.
+        * Phys. addr. in big endian order. (Big endian as defined by Intel.)
+        */
        SC_ISCP(sc)->iscp_scb_addr = IEE_SWAP32(IEE_PHYS_SHMEM(sc->sc_scb_off));
        /* Set pointer to Receive Frame Area. (physical address) */
        SC_SCB(sc)->scb_rfa_addr = IEE_SWAPA32(IEE_PHYS_SHMEM(sc->sc_rfd_off));
@@ -638,7 +642,7 @@
            IEE_SWAPA32(IEE_PHYS_SHMEM(sc->sc_cb_off));
 
        bus_dmamap_sync(sc->sc_dmat, sc->sc_shmem_map, 0, sc->sc_shmem_sz,
-           BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+           BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 
        ifmedia_init(&sc->sc_ifmedia, 0, iee_mediachange, iee_mediastatus);
        if (media != NULL) {
@@ -681,7 +685,6 @@
 }
 
 
-
 void
 iee_detach(struct iee_softc *sc, int flags)
 {
@@ -698,8 +701,7 @@
 }
 
 
-
-/* media change and status callback */
+/* Media change and status callback */
 int
 iee_mediachange(struct ifnet *ifp)
 {
@@ -711,7 +713,6 @@
 }
 
 
-
 void
 iee_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmreq)
 {
@@ -722,8 +723,7 @@
 }
 
 
-
-/* initiate output routine */
+/* Initiate output routine */
 void
 iee_start(struct ifnet *ifp)
 {
@@ -833,7 +833,7 @@
        switch (cmd) {
        case SIOCSIFMEDIA:
        case SIOCGIFMEDIA:
-               err = ifmedia_ioctl(ifp, (struct ifreq *) data,
+               err = ifmedia_ioctl(ifp, (struct ifreq *)data,
                    &sc->sc_ifmedia, cmd);
                break;
 
@@ -923,7 +923,8 @@
                                err = 1;
                                break;
                        }
-                       MCLAIM(sc->sc_rx_mbuf[r],&sc->sc_ethercom.ec_rx_mowner);
+                       MCLAIM(sc->sc_rx_mbuf[r],
+                           &sc->sc_ethercom.ec_rx_mowner);
                        MCLGET(sc->sc_rx_mbuf[r], M_DONTWAIT);
                        if ((sc->sc_rx_mbuf[r]->m_flags & M_EXT) == 0) {
                                printf("%s: iee_init: can't allocate mbuf"
@@ -940,13 +941,13 @@
                if (sc->sc_rx_map[r] == NULL && bus_dmamap_create(sc->sc_dmat,
                    MCLBYTES, 1, MCLBYTES , 0, BUS_DMA_NOWAIT,
                    &sc->sc_rx_map[r]) != 0) {
-                               printf("%s: iee_init: can't create RX "
-                                   "DMA map\n", device_xname(sc->sc_dev));
-                               m_freem(sc->sc_rx_mbuf[r]);
-                               sc->sc_rx_mbuf[r] = NULL;
-                               err = 1;
-                               break;
-                       }
+                       printf("%s: iee_init: can't create RX DMA map\n",
+                           device_xname(sc->sc_dev));
+                       m_freem(sc->sc_rx_mbuf[r]);
+                       sc->sc_rx_mbuf[r] = NULL;
+                       err = 1;
+                       break;
+               }
                if (bus_dmamap_load_mbuf(sc->sc_dmat, sc->sc_rx_map[r],
                    sc->sc_rx_mbuf[r], BUS_DMA_READ | BUS_DMA_NOWAIT) != 0) {
                        printf("%s: iee_init: can't load RX DMA map\n",
@@ -1000,7 +1001,7 @@
        iee_cb_setup(sc, IEE_CB_CMD_CONF | IEE_CB_S | IEE_CB_EL);
        SC_SCB(sc)->scb_rfa_addr = IEE_SWAPA32(IEE_PHYS_SHMEM(sc->sc_rfd_off));
        bus_dmamap_sync(sc->sc_dmat, sc->sc_shmem_map, 0, sc->sc_shmem_sz,
-           BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+           BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
        (sc->sc_iee_cmd)(sc, IEE_SCB_CUC_EXE | IEE_SCB_RUC_ST);
        /* Issue a Channel Attention to ACK interrupts we may have caused. */
        (sc->sc_iee_cmd)(sc, IEE_SCB_ACK);
@@ -1012,8 +1013,7 @@
 }
 
 
-
-/* stop routine */
+/* Stop routine */
 void
 iee_stop(struct ifnet *ifp, int disable)
 {
@@ -1046,8 +1046,7 @@
 }
 
 
-
-/* timer routine */
+/* Timer routine */
 void
 iee_watchdog(struct ifnet *ifp)
 {



Home | Main Index | Thread Index | Old Index