Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/0b4c6b2e374f
branches:  trunk
changeset: 969809:0b4c6b2e374f
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Mar 02 06:38:06 2020 +0000

description:
KNF. No functional change.

diffstat:

 sys/dev/pci/if_gem_pci.c |  51 ++++++++++++++++++++++++++---------------------
 1 files changed, 28 insertions(+), 23 deletions(-)

diffs (135 lines):

diff -r 9bd933635da7 -r 0b4c6b2e374f sys/dev/pci/if_gem_pci.c
--- a/sys/dev/pci/if_gem_pci.c  Mon Mar 02 04:25:08 2020 +0000
+++ b/sys/dev/pci/if_gem_pci.c  Mon Mar 02 06:38:06 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gem_pci.c,v 1.49 2020/03/01 05:51:46 thorpej Exp $ */
+/*     $NetBSD: if_gem_pci.c,v 1.50 2020/03/02 06:38:06 msaitoh Exp $ */
 
 /*
  *
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.49 2020/03/01 05:51:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.50 2020/03/02 06:38:06 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -105,7 +105,7 @@
            (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_GMAC ||
             PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_GMAC2 ||
             PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_GMAC3 ||
-            PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_SHASTA_GMAC ||
+            PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_SHASTA_GMAC ||
             PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_K2_GMAC ||
             PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_SHASTA_GMAC ||
             PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_INTREPID2_GMAC))
@@ -219,12 +219,14 @@
            PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT, 0,
            &sc->sc_bustag, &sc->sc_h1, NULL, &sc->sc_size) != 0)
        {
-               aprint_error_dev(sc->sc_dev, "unable to map device registers\n");
+               aprint_error_dev(sc->sc_dev,
+                   "unable to map device registers\n");
                return;
        }
        if (bus_space_subregion(sc->sc_bustag, sc->sc_h1,
            GEM_PCI_BANK2_OFFSET, GEM_PCI_BANK2_SIZE, &sc->sc_h2)) {
-               aprint_error_dev(sc->sc_dev, "unable to create bank 2 subregion\n");
+               aprint_error_dev(sc->sc_dev,
+                   "unable to create bank 2 subregion\n");
                return;
        }
 
@@ -233,7 +235,7 @@
                memcpy(enaddr, prop_data_data_nocopy(data), ETHER_ADDR_LEN);
                got_addr = 1;
                if ((data = prop_dictionary_get(device_properties(sc->sc_dev),
-                   "shared-pins")) != NULL) {
+                   "shared-pins")) != NULL) {
                        memcpy(buf, prop_data_data_nocopy(data),
                            prop_data_size(data));
                        if (isserdes(buf)) {
@@ -242,12 +244,12 @@
                }
        } else {
                /*
-                * Dig out VPD (vital product data) and acquire Ethernet address.
-                * The VPD of gem resides in the PCI PROM (PCI FCode).
+                * Dig out VPD (vital product data) and acquire Ethernet
+                * address. The VPD of gem resides in the PCI PROM (PCI FCode).
                 */
                /*
-                * ``Writing FCode 3.x Programs'' (newer ones, dated 1997 and later)
-                * chapter 2 describes the data structure.
+                * ``Writing FCode 3.x Programs'' (newer ones, dated 1997 and
+                * later) chapter 2 describes the data structure.
                 */
 
                enp = NULL;
@@ -279,8 +281,8 @@
                        }
 #ifdef GEM_DEBUG
                        /* PROM dump */
-                       printf("%s: PROM dump (0x0000 to %04zx)\n", device_xname(sc->sc_dev),
-                           (sizeof buf) - 1);
+                       printf("%s: PROM dump (0x0000 to %04zx)\n",
+                           device_xname(sc->sc_dev), (sizeof buf) - 1);
                        i = 0;
                        j = 0;
                        printf("  %04x  ", i);
@@ -310,23 +312,24 @@
                                (buf[PROMHDR_PTR_DATA + 1] << 8))) >= 0x1c) {
 
                                /* read PCI Expansion PROM Data */
-                               bus_space_read_region_1(sc->sc_bustag, romh, dataoff,
-                                   buf, 64);
+                               bus_space_read_region_1(sc->sc_bustag, romh,
+                                   dataoff, buf, 64);
                                if (memcmp(buf, promdat, sizeof promdat) == 0 &&
                                    gempromvalid(buf + PROMDATA_DATA2) &&
                                    (vpdoff = (buf[PROMDATA_PTR_VPD] |
                                        (buf[PROMDATA_PTR_VPD + 1] << 8))) >= 0x1c) {
 
                                        /*
-                                        * The VPD of gem is not in PCI 2.2 standard
-                                        * format.  The length in the resource header
-                                        * is in big endian, and resources are not
-                                        * properly terminated (only one resource
-                                        * and no end tag).
+                                        * The VPD of gem is not in PCI 2.2
+                                        * standard format.  The length in the
+                                        * resource header is in big endian,
+                                        * and resources are not properly
+                                        * terminated (only one resource and no
+                                        * end tag).
                                         */
                                        /* read PCI VPD */
-                                       bus_space_read_region_1(sc->sc_bustag, romh,
-                                           vpdoff, buf, 64);
+                                       bus_space_read_region_1(sc->sc_bustag,
+                                           romh, vpdoff, buf, 64);
                                        vpd = (void *)(buf + 3);
                                        if (PCI_VPDRES_ISLARGE(buf[0]) &&
                                            PCI_VPDRES_LARGE_NAME(buf[0])
@@ -349,7 +352,8 @@
                }
        }
        if (!got_addr) {
-               printf("%s: no Ethernet address found\n", device_xname(sc->sc_dev));
+               printf("%s: no Ethernet address found\n",
+                   device_xname(sc->sc_dev));
                /* should we bail here? */
        }
 
@@ -391,7 +395,8 @@
        const char *intrstr;
        char intrbuf[PCI_INTRSTR_LEN];
 
-       intrstr = pci_intr_string(gsc->gsc_pc, gsc->gsc_handle, intrbuf, sizeof(intrbuf));
+       intrstr = pci_intr_string(gsc->gsc_pc, gsc->gsc_handle, intrbuf,
+           sizeof(intrbuf));
        gsc->gsc_ih = pci_intr_establish_xname(gsc->gsc_pc, gsc->gsc_handle,
            IPL_NET, gem_intr, sc, device_xname(sc->sc_dev));
        if (gsc->gsc_ih == NULL) {



Home | Main Index | Thread Index | Old Index