Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Drop unused prototype. Whitespace fixes. Wrap/re-...



details:   https://anonhg.NetBSD.org/src/rev/936c1965d94c
branches:  trunk
changeset: 353225:936c1965d94c
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Mon Apr 24 12:58:15 2017 +0000

description:
Drop unused prototype. Whitespace fixes. Wrap/re-wrap long lines.

diffstat:

 sys/dev/ic/siisata.c |  106 +++++++++++++++++++++++++-------------------------
 1 files changed, 54 insertions(+), 52 deletions(-)

diffs (truncated from 323 to 300 lines):

diff -r cb8f570f3dc2 -r 936c1965d94c sys/dev/ic/siisata.c
--- a/sys/dev/ic/siisata.c      Mon Apr 24 12:53:28 2017 +0000
+++ b/sys/dev/ic/siisata.c      Mon Apr 24 12:58:15 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30 2017/01/03 01:30:15 jakllsch Exp $ */
+/* $NetBSD: siisata.c,v 1.31 2017/04/24 12:58:15 jakllsch Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30 2017/01/03 01:30:15 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.31 2017/04/24 12:58:15 jakllsch Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -122,7 +122,8 @@
 }
 
 static inline void
-bus_space_read_region_stream_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, uint32_t *p, bus_size_t c)
+bus_space_read_region_stream_4(bus_space_tag_t t, bus_space_handle_t h,
+    bus_size_t o, uint32_t *p, bus_size_t c)
 {
        bus_space_read_region_4(t, h, o, p, c);
        for (bus_size_t i = 0; i < c; i++) {
@@ -161,8 +162,8 @@
 static void siisata_device_reset(struct ata_channel *);
 static void siisata_activate_prb(struct siisata_channel *, int);
 static void siisata_deactivate_prb(struct siisata_channel *, int);
-static int siisata_dma_setup(struct ata_channel *chp, int slot,
-    void *data, size_t, int);
+static int siisata_dma_setup(struct ata_channel *chp, int, void *,
+    size_t, int);
 
 #if NATAPIBUS > 0
 void siisata_atapibus_attach(struct atabus_softc *);
@@ -171,7 +172,6 @@
 void siisata_atapi_start(struct ata_channel *,struct ata_xfer *);
 int siisata_atapi_complete(struct ata_channel *, struct ata_xfer *, int);
 void siisata_atapi_kill_xfer(struct ata_channel *, struct ata_xfer *, int);
-void siisata_atapi_done(struct ata_channel *, struct ata_xfer *, int);
 void siisata_atapi_scsipi_request(struct scsipi_channel *,
     scsipi_adapter_req_t, void *);
 void siisata_atapi_kill_pending(struct scsipi_periph *);
@@ -219,7 +219,7 @@
        sc->sc_atac.atac_set_modes = siisata_setup_channel;
 #if NATAPIBUS > 0
        sc->sc_atac.atac_atapibus_attach = siisata_atapibus_attach;
-#endif 
+#endif
 
        /* come out of reset state */
        GRWRITE(sc, GR_GC, 0);
@@ -228,9 +228,8 @@
                siisata_attach_port(sc, i);
        }
 
-       SIISATA_DEBUG_PRINT(("%s: %s: GR_GC: 0x%08x\n",
-           SIISATANAME(sc), __func__, GRREAD(sc, GR_GC)),
-           DEBUG_FUNCS);
+       SIISATA_DEBUG_PRINT(("%s: %s: GR_GC: 0x%08x\n", SIISATANAME(sc),
+           __func__, GRREAD(sc, GR_GC)), DEBUG_FUNCS);
        return;
 }
 
@@ -449,7 +448,7 @@
        for (i = 0; i < sc->sc_atac.atac_nchannels; i++) {
                siisata_init_port(sc, i);
        }
-       
+
 }
 
 int
@@ -486,8 +485,8 @@
 
        pis = PRREAD(sc, PRX(chp->ch_channel, PRO_PIS));
 
-       SIISATA_DEBUG_PRINT(("%s: %s port %d, pis 0x%x ",
-           SIISATANAME(sc), __func__, chp->ch_channel, pis), DEBUG_INTR);
+       SIISATA_DEBUG_PRINT(("%s: %s port %d, pis 0x%x ", SIISATANAME(sc),
+           __func__, chp->ch_channel, pis), DEBUG_INTR);
 
        if (pis & PR_PIS_CMDCMPL) {
                /* get slot status, clearing completion interrupt */
@@ -500,7 +499,7 @@
                            "completion on port %d\n",
                            SIISATANAME(sc), chp->ch_channel);
                        return;
-               } 
+               }
                if ((~pss & __BIT(slot)) == 0) {
                        aprint_error( "%s: unknown slot "
                            "completion on port %d, pss 0x%x\n",
@@ -521,7 +520,7 @@
                                /* read in specific information about error */
                                prbfis = bus_space_read_stream_4(
                                    sc->sc_prt, sc->sc_prh,
-                                   PRSX(chp->ch_channel, slot, PRSO_FIS));
+                                   PRSX(chp->ch_channel, slot, PRSO_FIS));
                                /* set ch_status and ch_error */
                                satafis_rdh_parse(chp, (uint8_t *)&prbfis);
                        }
@@ -829,9 +828,8 @@
        int i;
 
        SIISATA_DEBUG_PRINT(("%s: %s port %d drive %d command 0x%x, slot %d\n",
-           SIISATANAME((struct siisata_softc *)chp->ch_atac),
-           __func__, chp->ch_channel, xfer->c_drive,
-           ata_c->r_command, slot),
+           SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__,
+           chp->ch_channel, xfer->c_drive, ata_c->r_command, slot),
            DEBUG_FUNCS|DEBUG_XFERS);
 
        chp->ch_status = 0;
@@ -854,7 +852,7 @@
        if (siisata_dma_setup(chp, slot,
            (ata_c->flags & (AT_READ | AT_WRITE)) ? ata_c->data : NULL,
            ata_c->bcount,
-           (ata_c->flags & AT_READ) ? BUS_DMA_READ : BUS_DMA_WRITE)) { 
+           (ata_c->flags & AT_READ) ? BUS_DMA_READ : BUS_DMA_WRITE)) {
                ata_c->flags |= AT_DF;
                siisata_cmd_complete(chp, xfer, slot);
                return;
@@ -893,8 +891,9 @@
        /* reenable interrupts */
        siisata_enable_port_interrupt(chp);
 out:
-       SIISATA_DEBUG_PRINT(
-           ("%s: %s: done\n", SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), DEBUG_FUNCS);
+       SIISATA_DEBUG_PRINT(("%s: %s: done\n",
+           SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__),
+           DEBUG_FUNCS);
        return;
 }
 
@@ -927,8 +926,8 @@
        struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac;
 #endif
 
-       SIISATA_DEBUG_PRINT(
-           ("%s: %s\n", SIISATANAME(sc), __func__), DEBUG_FUNCS|DEBUG_XFERS);
+       SIISATA_DEBUG_PRINT(("%s: %s\n", SIISATANAME(sc), __func__),
+           DEBUG_FUNCS|DEBUG_XFERS);
 
        chp->ch_flags &= ~ATACH_IRQ_WAIT;
        if (xfer->c_flags & C_TIMEOU)
@@ -945,7 +944,8 @@
 
        if (chp->ch_drive[xfer->c_drive].drive_flags & ATA_DRIVE_WAITDRAIN) {
                siisata_cmd_kill_xfer(chp, xfer, KILL_GONE);
-               chp->ch_drive[xfer->c_drive].drive_flags &= ~ATA_DRIVE_WAITDRAIN;
+               chp->ch_drive[xfer->c_drive].drive_flags &=
+                   ~ATA_DRIVE_WAITDRAIN;
                wakeup(&chp->ch_queue->active_xfer);
                return 0;
        } else
@@ -964,9 +964,8 @@
        uint16_t *idwordbuf;
        int i;
 
-       SIISATA_DEBUG_PRINT(
-           ("%s: %s flags 0x%x error 0x%x\n", SIISATANAME(sc), __func__,
-               ata_c->flags, ata_c->r_error), DEBUG_FUNCS|DEBUG_XFERS);
+       SIISATA_DEBUG_PRINT(("%s: %s flags 0x%x error 0x%x\n", SIISATANAME(sc),
+           __func__, ata_c->flags, ata_c->r_error), DEBUG_FUNCS|DEBUG_XFERS);
 
        siisata_deactivate_prb(schp, slot);
 
@@ -1014,9 +1013,9 @@
        struct ata_channel *chp = drvp->chnl_softc;
        struct ata_xfer *xfer;
 
-       SIISATA_DEBUG_PRINT( ("%s: %s.\n",
-           SIISATANAME((struct siisata_softc *)chp->ch_atac),
-           __func__), DEBUG_FUNCS);
+       SIISATA_DEBUG_PRINT(("%s: %s.\n",
+           SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__),
+           DEBUG_FUNCS);
 
        xfer = ata_get_xfer(ATAXF_NOSLEEP);
        if (xfer == NULL)
@@ -1044,10 +1043,9 @@
        int slot = SIISATA_NON_NCQ_SLOT;
        int i;
 
-       SIISATA_DEBUG_PRINT(
-           ("%s: %s port %d, slot %d\n",
-           SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__, chp->ch_channel, slot),
-           DEBUG_FUNCS);
+       SIISATA_DEBUG_PRINT(("%s: %s port %d, slot %d\n",
+           SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__,
+           chp->ch_channel, slot), DEBUG_FUNCS);
 
        chp->ch_status = 0;
        chp->ch_error = 0;
@@ -1096,8 +1094,9 @@
 
        siisata_enable_port_interrupt(chp);
 out:
-       SIISATA_DEBUG_PRINT(
-           ("%s: %s: done\n", SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), DEBUG_FUNCS);
+       SIISATA_DEBUG_PRINT(("%s: %s: done\n",
+           SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__),
+           DEBUG_FUNCS);
        return;
 }
 
@@ -1111,8 +1110,8 @@
        int slot = SIISATA_NON_NCQ_SLOT;
 
        SIISATA_DEBUG_PRINT(("%s: %s: port %d\n",
-           SIISATANAME((struct siisata_softc *)chp->ch_atac),
-           __func__, chp->ch_channel), DEBUG_FUNCS);
+           SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__,
+           chp->ch_channel), DEBUG_FUNCS);
 
        siisata_deactivate_prb(schp, slot);
 
@@ -1158,7 +1157,8 @@
 
        if (chp->ch_drive[xfer->c_drive].drive_flags & ATA_DRIVE_WAITDRAIN) {
                siisata_bio_kill_xfer(chp, xfer, KILL_GONE);
-               chp->ch_drive[xfer->c_drive].drive_flags &= ~ATA_DRIVE_WAITDRAIN;
+               chp->ch_drive[xfer->c_drive].drive_flags &=
+                   ~ATA_DRIVE_WAITDRAIN;
                wakeup(&chp->ch_queue->active_xfer);
                return 0;
        }
@@ -1174,8 +1174,8 @@
        } else if (chp->ch_status & WDCS_CORR)
                ata_bio->flags |= ATA_CORR;
 
-       SIISATA_DEBUG_PRINT(("%s: %s bcount: %ld", SIISATANAME(sc),
-           __func__, ata_bio->bcount), DEBUG_XFERS); 
+       SIISATA_DEBUG_PRINT(("%s: %s bcount: %ld", SIISATANAME(sc), __func__,
+           ata_bio->bcount), DEBUG_XFERS);
        if (ata_bio->error == NOERROR) {
                if (ata_bio->flags & ATA_READ)
                        ata_bio->bcount -=
@@ -1183,7 +1183,7 @@
                else
                        ata_bio->bcount = 0;
        }
-       SIISATA_DEBUG_PRINT((" now %ld\n", ata_bio->bcount), DEBUG_XFERS); 
+       SIISATA_DEBUG_PRINT((" now %ld\n", ata_bio->bcount), DEBUG_XFERS);
        if (ata_bio->flags & ATA_POLL)
                return 1;
        (*chp->ch_drive[drive].drv_done)(chp->ch_drive[drive].drv_softc);
@@ -1284,7 +1284,7 @@
 siisata_deactivate_prb(struct siisata_channel *schp, int slot)
 {
        struct siisata_softc *sc;
-       
+
        sc = (struct siisata_softc *)schp->ata_channel.ch_atac;
 
        KASSERTMSG((schp->sch_active_slots & __BIT(slot)) != 0,
@@ -1422,8 +1422,8 @@
 
        /* if no ATAPI device detected at attach time, skip */
        if (drvp->drive_type != ATA_DRIVET_ATAPI) {
-               SIISATA_DEBUG_PRINT(("%s: drive %d "
-                   "not present\n", __func__, target), DEBUG_PROBE);
+               SIISATA_DEBUG_PRINT(("%s: drive %d not present\n", __func__,
+                   target), DEBUG_PROBE);
                return;
        }
 
@@ -1479,7 +1479,7 @@
                if ((id->atap_config & ATAPI_CFG_CMD_MASK)
                    == ATAPI_CFG_CMD_16) {
                        periph->periph_cap |= PERIPH_CAP_CMD16;
-               
+
                        /* configure port for packet length */
                        PRWRITE(siic, PRX(chp->ch_channel, PRO_PCS),
                            PR_PC_PACKET_LENGTH);
@@ -1648,8 +1648,9 @@
        /* reenable interrupts */
        siisata_enable_port_interrupt(chp);
 out:
-       SIISATA_DEBUG_PRINT(
-           ("%s: %s: done\n", SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__), DEBUG_FUNCS);
+       SIISATA_DEBUG_PRINT(("%s: %s: done\n",
+           SIISATANAME((struct siisata_softc *)chp->ch_atac), __func__),
+           DEBUG_FUNCS);
        return;
 }
 
@@ -1661,8 +1662,8 @@
        struct siisata_channel *schp = (struct siisata_channel *)chp;
        struct scsipi_xfer *sc_xfer = xfer->c_cmd;
 
-       SIISATA_DEBUG_PRINT(
-           ("%s: %s()\n", SIISATANAME(sc), __func__), DEBUG_INTR);
+       SIISATA_DEBUG_PRINT(("%s: %s()\n", SIISATANAME(sc), __func__),



Home | Main Index | Thread Index | Old Index