Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/0147da857da3
branches:  trunk
changeset: 456154:0147da857da3
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Apr 25 10:44:52 2019 +0000

description:
KNF. No functional change.

diffstat:

 sys/arch/acorn32/eb7500atx/if_cs.c |  22 ++++++++++------------
 sys/dev/ic/rtl80x9.c               |  24 ++++++++++++------------
 sys/dev/sbus/if_le_ledma.c         |  34 ++++++++++++++++------------------
 3 files changed, 38 insertions(+), 42 deletions(-)

diffs (269 lines):

diff -r 4b3dc4c9e7ac -r 0147da857da3 sys/arch/acorn32/eb7500atx/if_cs.c
--- a/sys/arch/acorn32/eb7500atx/if_cs.c        Thu Apr 25 10:08:45 2019 +0000
+++ b/sys/arch/acorn32/eb7500atx/if_cs.c        Thu Apr 25 10:44:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cs.c,v 1.11 2019/04/25 10:08:45 msaitoh Exp $       */
+/*     $NetBSD: if_cs.c,v 1.12 2019/04/25 10:44:53 msaitoh Exp $       */
 
 /*
  * Copyright (c) 2004 Christopher Gilbert
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cs.c,v 1.11 2019/04/25 10:08:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cs.c,v 1.12 2019/04/25 10:44:53 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -145,7 +145,7 @@
        cs_rsbus_bs_tag = *rs->sa_iot;
 
        /* Registers are normally accessed in pairs, on a 4 byte aligned */
-       cs_rsbus_bs_tag.bs_cookie = (void *) 1;
+       cs_rsbus_bs_tag.bs_cookie = (void *)1;
 
        sc->sc_iot = sc->sc_memt = &cs_rsbus_bs_tag;
 
@@ -195,11 +195,11 @@
        sc->sc_io_read_1 = cs_rbus_read_1;
 
        /*
-        * also provide media, otherwise it attempts to read the media from
+        * Also provide media, otherwise it attempts to read the media from
         * the EEPROM, which again fails
         */
        cs_attach(sc, NULL, cs_rbus_media, __arraycount(cs_rbus_media),
-           IFM_ETHER |IFM_10_T | IFM_FDX);
+           IFM_ETHER | IFM_10_T | IFM_FDX);
 }
 
 /*
@@ -210,20 +210,18 @@
 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 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
+        * Otherwise we've get to work out the aligned address and then add
         * one
         */
        offset = (a & ~1) << 1;
        offset++;
 
-       /* and read it, with no shift (cookie is 0) */
+       /* And read it, with no shift (cookie is 0) */
        return sc->sc_iot->bs_r_1(0, (sc)->sc_ioh, offset);
 }
diff -r 4b3dc4c9e7ac -r 0147da857da3 sys/dev/ic/rtl80x9.c
--- a/sys/dev/ic/rtl80x9.c      Thu Apr 25 10:08:45 2019 +0000
+++ b/sys/dev/ic/rtl80x9.c      Thu Apr 25 10:44:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl80x9.c,v 1.17 2019/04/25 10:08:45 msaitoh Exp $     */
+/*     $NetBSD: rtl80x9.c,v 1.18 2019/04/25 10:44:52 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl80x9.c,v 1.17 2019/04/25 10:08:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl80x9.c,v 1.18 2019/04/25 10:44:52 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -114,11 +114,11 @@
 
        /* Write enable config1-3. */
        NIC_PUT(sc->sc_regt, sc->sc_regh, NERTL_RTL3_EECR,
-           RTL3_EECR_EEM1|RTL3_EECR_EEM0);
+           RTL3_EECR_EEM1 | RTL3_EECR_EEM0);
 
        /* First, set basic media type. */
        reg = NIC_GET(sc->sc_regt, sc->sc_regh, NERTL_RTL3_CONFIG2);
-       reg &= ~(RTL3_CONFIG2_PL1|RTL3_CONFIG2_PL0);
+       reg &= ~(RTL3_CONFIG2_PL1 | RTL3_CONFIG2_PL0);
        switch (IFM_SUBTYPE(ifm->ifm_cur->ifm_media)) {
        case IFM_AUTO:
                /* Nothing to do; both bits clear == auto-detect. */
@@ -133,7 +133,7 @@
                break;
 
        case IFM_10_2:
-               reg |= RTL3_CONFIG2_PL1|RTL3_CONFIG2_PL0;
+               reg |= RTL3_CONFIG2_PL1 | RTL3_CONFIG2_PL0;
                break;
        }
        NIC_PUT(sc->sc_regt, sc->sc_regh, NERTL_RTL3_CONFIG2, reg);
@@ -159,7 +159,7 @@
        static int rtl80x9_media[] = {
                IFM_ETHER | IFM_AUTO,
                IFM_ETHER | IFM_10_T,
-               IFM_ETHER | IFM_10_T|IFM_FDX,
+               IFM_ETHER | IFM_10_T | IFM_FDX,
                IFM_ETHER | IFM_10_2,
        };
        static const int rtl80x9_nmedia = __arraycount(rtl80x9_media);
@@ -176,26 +176,26 @@
        conf3 = bus_space_read_1(sc->sc_regt, sc->sc_regh, NERTL_RTL3_CONFIG3);
        printf("[0x%02x 0x%02x] ", conf2, conf3);
 
-       conf2 &= RTL3_CONFIG2_PL1|RTL3_CONFIG2_PL0;
+       conf2 &= RTL3_CONFIG2_PL1 | RTL3_CONFIG2_PL0;
 
        switch (conf2) {
        default:
-               defmedia = IFM_ETHER|IFM_AUTO;
+               defmedia = IFM_ETHER | IFM_AUTO;
                printf("auto\n");
                break;
 
-       case RTL3_CONFIG2_PL1|RTL3_CONFIG2_PL0:
+       case RTL3_CONFIG2_PL1 | RTL3_CONFIG2_PL0:
        case RTL3_CONFIG2_PL1:  /* XXX rtl docs sys 10base5, but chip cant do */
-               defmedia = IFM_ETHER|IFM_10_2;
+               defmedia = IFM_ETHER | IFM_10_2;
                printf("10base2\n");
                break;
 
        case RTL3_CONFIG2_PL0:
                if (conf3 & RTL3_CONFIG3_FUDUP) {
-                       defmedia = IFM_ETHER|IFM_10_T|IFM_FDX;
+                       defmedia = IFM_ETHER | IFM_10_T | IFM_FDX;
                        printf("10baseT-FDX\n");
                } else {
-                       defmedia = IFM_ETHER|IFM_10_T;
+                       defmedia = IFM_ETHER | IFM_10_T;
                        printf("10baseT\n");
                }
                break;
diff -r 4b3dc4c9e7ac -r 0147da857da3 sys/dev/sbus/if_le_ledma.c
--- a/sys/dev/sbus/if_le_ledma.c        Thu Apr 25 10:08:45 2019 +0000
+++ b/sys/dev/sbus/if_le_ledma.c        Thu Apr 25 10:44:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le_ledma.c,v 1.35 2010/01/19 22:07:43 pooka Exp $   */
+/*     $NetBSD: if_le_ledma.c,v 1.36 2019/04/25 10:44:53 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le_ledma.c,v 1.35 2010/01/19 22:07:43 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le_ledma.c,v 1.36 2019/04/25 10:44:53 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -95,9 +95,9 @@
  * Media types supported by the Sun4m.
  */
 static int lemedia[] = {
-       IFM_ETHER|IFM_10_T,
-       IFM_ETHER|IFM_10_5,
-       IFM_ETHER|IFM_AUTO,
+       IFM_ETHER | IFM_10_T,
+       IFM_ETHER | IFM_10_5,
+       IFM_ETHER | IFM_AUTO,
 };
 #define NLEMEDIA       __arraycount(lemedia)
 
@@ -148,7 +148,7 @@
        bus_space_handle_t h = lesc->sc_reg;
 
        bus_space_write_2(t, h, LEREG1_RAP, port);
-       return (bus_space_read_2(t, h, LEREG1_RDP));
+       return bus_space_read_2(t, h, LEREG1_RDP);
 }
 
 void
@@ -181,7 +181,7 @@
        struct ifmedia *ifm = &sc->sc_media;
 
        if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
-               return (EINVAL);
+               return EINVAL;
 
        /*
         * Switch to the selected media.  If autoselect is
@@ -202,10 +202,10 @@
                break;
 
        default:
-               return (EINVAL);
+               return EINVAL;
        }
 
-       return (0);
+       return 0;
 }
 
 void
@@ -217,9 +217,9 @@
         * Notify the world which media we're currently using.
         */
        if (L64854_GCSR(dma) & E_TP_AUI)
-               ifmr->ifm_active = IFM_ETHER|IFM_10_T;
+               ifmr->ifm_active = IFM_ETHER | IFM_10_T;
        else
-               ifmr->ifm_active = IFM_ETHER|IFM_10_5;
+               ifmr->ifm_active = IFM_ETHER | IFM_10_5;
 }
 
 static void
@@ -351,23 +351,21 @@
 
        /* Get a DMA handle */
        if ((error = bus_dmamap_create(dmatag, MEMSIZE, 1, MEMSIZE,
-                                       LEDMA_BOUNDARY, BUS_DMA_NOWAIT,
-                                       &lesc->sc_dmamap)) != 0) {
+           LEDMA_BOUNDARY, BUS_DMA_NOWAIT, &lesc->sc_dmamap)) != 0) {
                aprint_error(": DMA map create error %d\n", error);
                return;
        }
 
        /* Allocate DMA buffer */
        if ((error = bus_dmamem_alloc(dmatag, MEMSIZE, 0, LEDMA_BOUNDARY,
-                                &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
+           &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
                aprint_error(": DMA buffer alloc error %d\n",error);
                return;
        }
 
        /* Map DMA buffer into kernel space */
        if ((error = bus_dmamem_map(dmatag, &seg, rseg, MEMSIZE,
-                              (void **)&sc->sc_mem,
-                              BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
+           (void **)&sc->sc_mem, BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0) {
                aprint_error(": DMA buffer map error %d\n", error);
                bus_dmamem_free(dmatag, &seg, rseg);
                return;
@@ -375,7 +373,7 @@
 
        /* Load DMA buffer */
        if ((error = bus_dmamap_load(dmatag, lesc->sc_dmamap, sc->sc_mem,
-                       MEMSIZE, NULL, BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
+           MEMSIZE, NULL, BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0) {
                aprint_error(": DMA buffer map load error %d\n", error);
                bus_dmamem_free(dmatag, &seg, rseg);
                bus_dmamem_unmap(dmatag, sc->sc_mem, MEMSIZE);
@@ -391,7 +389,7 @@
        sc->sc_mediastatus = lemediastatus;
        sc->sc_supmedia = lemedia;
        sc->sc_nsupmedia = NLEMEDIA;
-       sc->sc_defaultmedia = IFM_ETHER|IFM_AUTO;
+       sc->sc_defaultmedia = IFM_ETHER | IFM_AUTO;
 
        prom_getether(sa->sa_node, sc->sc_enaddr);
 



Home | Main Index | Thread Index | Old Index