diff --git a/sys/dev/ida/ida.c b/sys/dev/ida/ida.c index 1f09cc1c019c..010dbfd11cf7 100644 --- a/sys/dev/ida/ida.c +++ b/sys/dev/ida/ida.c @@ -100,7 +100,7 @@ ida_free(struct ida_softc *ida) free(ida->qcbs, M_DEVBUF); if (ida->ih != NULL) - bus_teardown_intr(ida->dev, ida->irq, ida->ih); + bus_teardown_intr(ida->dev, ida->irq, ida->ih); if (ida->irq != NULL) bus_release_resource(ida->dev, ida->irq_res_type, @@ -118,12 +118,12 @@ ida_free(struct ida_softc *ida) * record bus address from bus_dmamap_load */ static void -ida_dma_map_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) +ida_dma_map_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - bus_addr_t *baddr; + bus_addr_t *baddr; - baddr = (bus_addr_t *)arg; - *baddr = segs->ds_addr; + baddr = (bus_addr_t *)arg; + *baddr = segs->ds_addr; } static __inline struct ida_qcb * @@ -197,7 +197,7 @@ ida_init(struct ida_softc *ida) SLIST_INIT(&ida->free_qcbs); STAILQ_INIT(&ida->qcb_queue); - bioq_init(&ida->bio_queue); + bioq_init(&ida->bio_queue); ida->qcbs = (struct ida_qcb *) malloc(IDA_QCB_MAX * sizeof(struct ida_qcb), M_DEVBUF, @@ -226,7 +226,7 @@ ida_init(struct ida_softc *ida) /* lockarg */ &Giant, &ida->hwqcb_dmat); if (error) - return (ENOMEM); + return (ENOMEM); /* DMA tag for mapping buffers into device space */ error = bus_dma_tag_create( @@ -245,17 +245,17 @@ ida_init(struct ida_softc *ida) /* lockarg */ &Giant, &ida->buffer_dmat); if (error) - return (ENOMEM); + return (ENOMEM); - /* Allocation of hardware QCBs */ + /* Allocation of hardware QCBs */ /* XXX allocation is rounded to hardware page size */ error = bus_dmamem_alloc(ida->hwqcb_dmat, (void **)&ida->hwqcbs, BUS_DMA_NOWAIT, &ida->hwqcb_dmamap); if (error) - return (ENOMEM); + return (ENOMEM); - /* And permanently map them in */ - bus_dmamap_load(ida->hwqcb_dmat, ida->hwqcb_dmamap, + /* And permanently map them in */ + bus_dmamap_load(ida->hwqcb_dmat, ida->hwqcb_dmamap, ida->hwqcbs, IDA_QCB_MAX * sizeof(struct ida_hardware_qcb), ida_dma_map_cb, &ida->hwqcb_busaddr, /*flags*/0); @@ -318,11 +318,11 @@ ida_detach(device_t dev) struct ida_softc *ida; int error = 0; - ida = (struct ida_softc *)device_get_softc(dev); + ida = (struct ida_softc *)device_get_softc(dev); /* * XXX - * before detaching, we must make sure that the system is + * before detaching, we must make sure that the system is * quiescent; nothing mounted, no pending activity. */ @@ -343,7 +343,7 @@ ida_setup_dmamap(void *arg, bus_dma_segment_t *segs, int nsegments, int error) struct ida_hardware_qcb *hwqcb = (struct ida_hardware_qcb *)arg; int i; - hwqcb->hdr.size = htole16((sizeof(struct ida_req) + + hwqcb->hdr.size = htole16((sizeof(struct ida_req) + sizeof(struct ida_sgb) * IDA_NSEG) >> 2); for (i = 0; i < nsegments; i++) { @@ -402,8 +402,8 @@ ida_command(struct ida_softc *ida, int command, void *data, int datasize, void ida_submit_buf(struct ida_softc *ida, struct bio *bp) { - bioq_insert_tail(&ida->bio_queue, bp); - ida_construct_qcb(ida); + bioq_insert_tail(&ida->bio_queue, bp); + ida_construct_qcb(ida); ida_start(ida); } diff --git a/sys/dev/ida/ida_eisa.c b/sys/dev/ida/ida_eisa.c index a4f8cd535522..719d38c33273 100644 --- a/sys/dev/ida/ida_eisa.c +++ b/sys/dev/ida/ida_eisa.c @@ -102,7 +102,7 @@ ida_v1_done(struct ida_softc *ida) ida_outb(ida, R_EISA_LOCAL_DOORBELL, EISA_CHANNEL_CLEAR); if (completed != 0) { - hwqcb = (struct ida_hardware_qcb *) + hwqcb = (struct ida_hardware_qcb *) ((bus_addr_t)ida->hwqcbs + ((completed & ~3) - ida->hwqcb_busaddr)); hwqcb->req.error = status; @@ -264,7 +264,7 @@ ida_eisa_probe(device_t dev) eisa_add_iospace(dev, (io_base + IDA_EISA_IOPORT_START), IDA_EISA_IOPORT_LEN, RESVADDR_NONE); - eisa_add_intr(dev, irq, EISA_TRIGGER_LEVEL); /* XXX ??? */ + eisa_add_intr(dev, irq, EISA_TRIGGER_LEVEL); /* XXX ??? */ return (0); } diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c index 4472e016fd80..0f2fd2a6fe0f 100644 --- a/sys/dev/ida/ida_pci.c +++ b/sys/dev/ida/ida_pci.c @@ -249,7 +249,7 @@ ida_pci_attach(device_t dev) * it appears that this board only does MEMIO access. */ if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "Only memory mapped I/O is supported\n"); + device_printf(dev, "Only memory mapped I/O is supported\n"); return (ENXIO); } @@ -292,13 +292,13 @@ ida_pci_attach(device_t dev) } rid = 0; - ida->irq_res_type = SYS_RES_IRQ; + ida->irq_res_type = SYS_RES_IRQ; ida->irq = bus_alloc_resource_any(dev, ida->irq_res_type, &rid, RF_ACTIVE | RF_SHAREABLE); - if (ida->irq == NULL) { - ida_free(ida); - return (ENOMEM); - } + if (ida->irq == NULL) { + ida_free(ida); + return (ENOMEM); + } error = bus_setup_intr(dev, ida->irq, INTR_TYPE_BIO | INTR_ENTROPY, ida_intr, ida, &ida->ih); if (error) { @@ -309,9 +309,9 @@ ida_pci_attach(device_t dev) error = ida_init(ida); if (error) { - ida_free(ida); - return (error); - } + ida_free(ida); + return (error); + } ida_attach(ida); ida->flags |= IDA_ATTACHED; diff --git a/sys/dev/ida/idareg.h b/sys/dev/ida/idareg.h index 2317a3de8813..bb6a17d9187f 100644 --- a/sys/dev/ida/idareg.h +++ b/sys/dev/ida/idareg.h @@ -86,7 +86,7 @@ #define CMD_REJECTED 0x14 /* - * command types + * command types */ #define CMD_GET_LOG_DRV_INFO 0x10 /* Identify controller */ #define CMD_GET_CTRL_INFO 0x11 /* Identify logical driver */ @@ -211,7 +211,7 @@ struct ida_controller_info { u_int8_t reserved[403]; } __packed; -/* +/* * CMD_SENSE_DRV_STATUS (0x12) * Sense logical drive status */ diff --git a/sys/dev/ida/idavar.h b/sys/dev/ida/idavar.h index 8b5654097767..9666b0e80e73 100644 --- a/sys/dev/ida/idavar.h +++ b/sys/dev/ida/idavar.h @@ -77,7 +77,7 @@ struct ida_hardware_qcb { struct ida_hdr hdr; /* 4 */ struct ida_req req; /* 12 */ struct ida_sgb seg[IDA_NSEG]; /* 256 */ - struct ida_qcb *qcb; /* 4 - qcb backpointer */ + struct ida_qcb *qcb; /* 4 - qcb backpointer */ }; typedef enum { @@ -117,7 +117,7 @@ struct ida_access { }; /* - * flags for the controller + * flags for the controller */ #define IDA_ATTACHED 0x01 /* attached */ #define IDA_FIRMWARE 0x02 /* firmware must be started */ @@ -197,7 +197,7 @@ extern struct ida_softc *ida_alloc(device_t dev, struct resource *regs, int regs_type, int regs_id, bus_dma_tag_t parent_dmat); extern void ida_free(struct ida_softc *ida); extern int ida_init(struct ida_softc *ida); -extern void ida_attach(struct ida_softc *ida); +extern void ida_attach(struct ida_softc *ida); extern int ida_command(struct ida_softc *ida, int command, void *data, int datasize, int drive, u_int32_t pblkno, int flags); extern void ida_submit_buf(struct ida_softc *ida, struct bio *bp);