Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/shark/ofw KNF, whitespace.



details:   https://anonhg.NetBSD.org/src/rev/9773c7f0102f
branches:  trunk
changeset: 353041:9773c7f0102f
user:      flxd <flxd%NetBSD.org@localhost>
date:      Tue Apr 18 12:17:12 2017 +0000

description:
KNF, whitespace.

diffstat:

 sys/arch/shark/ofw/vlpci.c |  42 +++++++++++++++++++++++++++---------------
 1 files changed, 27 insertions(+), 15 deletions(-)

diffs (170 lines):

diff -r 6ab2b85a03a2 -r 9773c7f0102f sys/arch/shark/ofw/vlpci.c
--- a/sys/arch/shark/ofw/vlpci.c        Tue Apr 18 11:49:50 2017 +0000
+++ b/sys/arch/shark/ofw/vlpci.c        Tue Apr 18 12:17:12 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vlpci.c,v 1.6 2017/03/12 10:19:40 martin Exp $ */
+/*     $NetBSD: vlpci.c,v 1.7 2017/04/18 12:17:12 flxd Exp $   */
 
 /*
  * Copyright (c) 2017 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vlpci.c,v 1.6 2017/03/12 10:19:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vlpci.c,v 1.7 2017/04/18 12:17:12 flxd Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -95,6 +95,7 @@
 static void
 regwrite_1(struct vlpci_softc * const sc, uint8_t off, uint8_t val)
 {
+
        mutex_spin_enter(&sc->sc_lock);
        bus_space_write_1(&isa_io_bs_tag, sc->sc_reg_ioh, 0, off);
        bus_space_write_1(&isa_io_bs_tag, sc->sc_reg_ioh, 1, val);
@@ -124,14 +125,17 @@
        addr |= regread_1(sc, regaddr + 1) << 16;
        attr = regread_1(sc, regaddr + 2);
        size = 0x00010000 << ((attr & 0x1c) >> 2);
-       printf("memory window #%d at %08x size %08x flags %x\n", num, addr, size, attr);
+       printf("memory window #%d at %08x size %08x flags %x\n", num, addr,
+           size, attr);
 }
 
 static int
-vlpci_map(void *t, bus_addr_t bpa, bus_size_t size, int cacheable, bus_space_handle_t *bshp)
+vlpci_map(void *t, bus_addr_t bpa, bus_size_t size, int cacheable,
+    bus_space_handle_t *bshp)
 {
+
        *bshp = vlpci_mem_vaddr - 0x02000000 + bpa;
-printf("%s: %08lx -> %08lx\n", __func__, bpa, *bshp);
+       printf("%s: %08lx -> %08lx\n", __func__, bpa, *bshp);
        return(0);
 }
 
@@ -143,10 +147,10 @@
 
        ret = vlpci_mem_paddr + addr + off;
 
-       if (flags & BUS_SPACE_MAP_PREFETCHABLE) {
+       if (flags & BUS_SPACE_MAP_PREFETCHABLE)
                return (arm_btop(ret) | ARM32_MMAP_WRITECOMBINE);
-       } else
-               return arm_btop(ret);   
+       else
+               return arm_btop(ret);
 }
 
 static int
@@ -202,7 +206,7 @@
        regwrite_1(sc, 0x81, 0x1);
 
        regwrite_1(sc, 0x82, 0x08); /* PCI dynamic acceleration decoding enable */
-       regwrite_1(sc, 0x83, 0x08); 
+       regwrite_1(sc, 0x83, 0x08);
        printf("reg 0x83 %02x\n", regread_1(sc, 0x83));
 
 #if 1
@@ -217,7 +221,7 @@
 #endif
 
        vlpci_mem_paddr = 0x02000000;   /* get from OF! */
-       
+
        /*
         * we map in 1MB at 0x02000000, so program window #1 accordingly
         */
@@ -231,7 +235,7 @@
        vlpci_memt.bs_cookie = (void *)vlpci_mem_vaddr;
        vlpci_memt.bs_map = vlpci_map;
        vlpci_memt.bs_mmap = vlpci_mmap;
-        
+
        pc->pc_conf_v = sc;
        pc->pc_attach_hook = vlpci_pc_attach_hook;
        pc->pc_bus_maxdevs = vlpci_pc_bus_maxdevs;
@@ -266,9 +270,9 @@
        pba.pba_pc = &sc->sc_pc;
        pba.pba_bus = 0;
 
-printf("dma %lx %lx, %lx\n", isa_bus_dma_tag._ranges[0].dr_sysbase,
-                        isa_bus_dma_tag._ranges[0].dr_busbase,
-                        isa_bus_dma_tag._ranges[0].dr_len);
+       printf("dma %lx %lx, %lx\n", isa_bus_dma_tag._ranges[0].dr_sysbase,
+           isa_bus_dma_tag._ranges[0].dr_busbase,
+           isa_bus_dma_tag._ranges[0].dr_len);
 
        vlpci_dump_window(sc, 0);
        vlpci_dump_window(sc, 1);
@@ -286,18 +290,21 @@
 static int
 vlpci_pc_bus_maxdevs(void *v, int busno)
 {
+
        return busno == 0 ? 32 : 0;
 }
 
 static pcitag_t
 vlpci_pc_make_tag(void *v, int b, int d, int f)
 {
+
        return (b << 16) | (d << 11) | (f << 8);
 }
 
 static void
 vlpci_pc_decompose_tag(void *v, pcitag_t tag, int *bp, int *dp, int *fp)
 {
+
        if (bp)
                *bp = (tag >> 16) & 0xff;
        if (dp)
@@ -356,6 +363,7 @@
 static int
 vlpci_pc_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ih)
 {
+
        switch (pa->pa_intrpin) {
        default:
        case 0:
@@ -375,13 +383,14 @@
 
        if (ih == PCI_INTERRUPT_PIN_NONE)
                return NULL;
-       snprintf(buf, len, "irq %2lu", ih);
+       snprintf(buf, len, "irq %lu", ih);
        return buf;
 }
 
 static const struct evcnt *
 vlpci_pc_intr_evcnt(void *v, pci_intr_handle_t ih)
 {
+
        return NULL;
 }
 
@@ -389,6 +398,7 @@
 vlpci_pc_intr_establish(void *v, pci_intr_handle_t pih, int ipl,
     int (*callback)(void *), void *arg)
 {
+
        if (pih == 0)
                return NULL;
 
@@ -406,6 +416,7 @@
 static int
 vlpci_pc_conf_hook(void *v, int b, int d, int f, pcireg_t id)
 {
+
        return PCI_CONF_DEFAULT /*& ~PCI_CONF_ENABLE_BM*/;
 }
 #endif
@@ -414,5 +425,6 @@
 vlpci_pc_conf_interrupt(void *v, int bus, int dev, int ipin, int swiz,
     int *ilinep)
 {
+
        *ilinep = 0xff; /* XXX */
 }



Home | Main Index | Thread Index | Old Index