diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-09-08 07:08:28 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-09-08 07:08:28 +0000 |
commit | 5ba8205317ad2d4f2f0591b3a1fac22670efb20a (patch) | |
tree | 339915595fb00ded5a02a0fc2ba662332e5a6e1c | |
parent | eef87ea35de033bc4e46ea56cae7839990c9efe0 (diff) |
expand switch cases so they're not so ugly and easier to read.
ok deraadt@
-rw-r--r-- | sys/dev/usb/ehci.c | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 0407f2cd9a5..283a6eb33ef 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.88 2008/08/18 04:28:18 kevlo Exp $ */ +/* $OpenBSD: ehci.c,v 1.89 2008/09/08 07:08:27 brad Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -388,10 +388,17 @@ ehci_init(ehci_softc_t *sc) /* frame list size at default, read back what we got and use that */ switch (EHCI_CMD_FLS(EOREAD4(sc, EHCI_USBCMD))) { - case 0: sc->sc_flsize = 1024; break; - case 1: sc->sc_flsize = 512; break; - case 2: sc->sc_flsize = 256; break; - case 3: return (USBD_IOERROR); + case 0: + sc->sc_flsize = 1024; + break; + case 1: + sc->sc_flsize = 512; + break; + case 2: + sc->sc_flsize = 256; + break; + case 3: + return (USBD_IOERROR); } err = usb_allocmem(&sc->sc_bus, sc->sc_flsize * sizeof(ehci_link_t), EHCI_FLALIGN_ALIGN, &sc->sc_fldma); @@ -400,9 +407,8 @@ ehci_init(ehci_softc_t *sc) DPRINTF(("%s: flsize=%d\n", sc->sc_bus.bdev.dv_xname,sc->sc_flsize)); sc->sc_flist = KERNADDR(&sc->sc_fldma, 0); - for (i = 0; i < sc->sc_flsize; i++) { + for (i = 0; i < sc->sc_flsize; i++) sc->sc_flist[i] = EHCI_NULL; - } EOWRITE4(sc, EHCI_PERIODICLISTBASE, DMAADDR(&sc->sc_fldma, 0)); @@ -856,10 +862,18 @@ ehci_idone(struct ehci_xfer *ex) case 0: panic("ehci: isoc xfer suddenly has 0 bInterval, " "invalid"); - case 1: uframes = 1; break; - case 2: uframes = 2; break; - case 3: uframes = 4; break; - default: uframes = 8; break; + case 1: + uframes = 1; + break; + case 2: + uframes = 2; + break; + case 3: + uframes = 4; + break; + default: + uframes = 8; + break; } for (itd = ex->itdstart; itd != NULL; itd = itd->xfer_next) { @@ -1321,10 +1335,18 @@ ehci_dump_link(ehci_link_t link, int type) printf("<"); if (type) { switch (EHCI_LINK_TYPE(link)) { - case EHCI_LINK_ITD: printf("ITD"); break; - case EHCI_LINK_QH: printf("QH"); break; - case EHCI_LINK_SITD: printf("SITD"); break; - case EHCI_LINK_FSTN: printf("FSTN"); break; + case EHCI_LINK_ITD: + printf("ITD"); + break; + case EHCI_LINK_QH: + printf("QH"); + break; + case EHCI_LINK_SITD: + printf("SITD"); + break; + case EHCI_LINK_FSTN: + printf("FSTN"); + break; } } printf(">"); @@ -1498,10 +1520,17 @@ ehci_open(usbd_pipe_handle pipe) /* XXX All this stuff is only valid for async. */ switch (dev->speed) { - case USB_SPEED_LOW: speed = EHCI_QH_SPEED_LOW; break; - case USB_SPEED_FULL: speed = EHCI_QH_SPEED_FULL; break; - case USB_SPEED_HIGH: speed = EHCI_QH_SPEED_HIGH; break; - default: panic("ehci_open: bad device speed %d", dev->speed); + case USB_SPEED_LOW: + speed = EHCI_QH_SPEED_LOW; + break; + case USB_SPEED_FULL: + speed = EHCI_QH_SPEED_FULL; + break; + case USB_SPEED_HIGH: + speed = EHCI_QH_SPEED_HIGH; + break; + default: + panic("ehci_open: bad device speed %d", dev->speed); } if (speed != EHCI_QH_SPEED_HIGH && xfertype == UE_ISOCHRONOUS) { printf("%s: *** Error: opening low/full speed isoc device on" |