Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb KNF
details: https://anonhg.NetBSD.org/src/rev/db60f101d18a
branches: trunk
changeset: 784179:db60f101d18a
user: skrll <skrll%NetBSD.org@localhost>
date: Mon Jan 21 07:37:06 2013 +0000
description:
KNF
diffstat:
sys/dev/usb/dwc_otg.c | 92 +++++++++++++++++++++++++-------------------------
1 files changed, 46 insertions(+), 46 deletions(-)
diffs (truncated from 368 to 300 lines):
diff -r d24b8fa695a6 -r db60f101d18a sys/dev/usb/dwc_otg.c
--- a/sys/dev/usb/dwc_otg.c Mon Jan 21 03:24:43 2013 +0000
+++ b/sys/dev/usb/dwc_otg.c Mon Jan 21 07:37:06 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_otg.c,v 1.28 2013/01/19 14:33:51 skrll Exp $ */
+/* $NetBSD: dwc_otg.c,v 1.29 2013/01/21 07:37:06 skrll Exp $ */
/*-
* Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.28 2013/01/19 14:33:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.29 2013/01/21 07:37:06 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1182,10 +1182,10 @@
err = usb_insert_transfer(xfer);
mutex_exit(&sc->sc_lock);
if (err)
- return (err);
+ return err;
/* Pipe isn't running, start first */
- return (dwc_otg_root_intr_start(SIMPLEQ_FIRST(&xfer->pipe->queue)));
+ return dwc_otg_root_intr_start(SIMPLEQ_FIRST(&xfer->pipe->queue));
}
Static usbd_status
@@ -1197,14 +1197,14 @@
DPRINTF("\n");
if (sc->sc_dying)
- return (USBD_IOERROR);
+ return USBD_IOERROR;
mutex_enter(&sc->sc_lock);
KASSERT(sc->sc_intrxfer == NULL);
sc->sc_intrxfer = xfer;
mutex_exit(&sc->sc_lock);
- return (USBD_IN_PROGRESS);
+ return USBD_IN_PROGRESS;
}
/* Abort a root interrupt request. */
@@ -1262,10 +1262,10 @@
err = usb_insert_transfer(xfer);
mutex_exit(&sc->sc_lock);
if (err)
- return (err);
+ return err;
/* Pipe isn't running, start first */
- return (dwc_otg_device_ctrl_start(SIMPLEQ_FIRST(&xfer->pipe->queue)));
+ return dwc_otg_device_ctrl_start(SIMPLEQ_FIRST(&xfer->pipe->queue));
}
Static usbd_status
@@ -1346,7 +1346,7 @@
return err;
/* Pipe isn't running, start first */
- return (dwc_otg_device_bulk_start(SIMPLEQ_FIRST(&xfer->pipe->queue)));
+ return dwc_otg_device_bulk_start(SIMPLEQ_FIRST(&xfer->pipe->queue));
}
Static usbd_status
@@ -1423,7 +1423,7 @@
return err;
/* Pipe isn't running, start first */
- return (dwc_otg_device_intr_start(SIMPLEQ_FIRST(&xfer->pipe->queue)));
+ return dwc_otg_device_intr_start(SIMPLEQ_FIRST(&xfer->pipe->queue));
}
Static usbd_status
@@ -1517,7 +1517,7 @@
return err;
/* Pipe isn't running, start first */
- return (dwc_otg_device_isoc_start(SIMPLEQ_FIRST(&xfer->pipe->queue)));
+ return dwc_otg_device_isoc_start(SIMPLEQ_FIRST(&xfer->pipe->queue));
}
#if 0
@@ -2192,11 +2192,11 @@
if (sc->sc_chan_state[x].wait_sof == 0) {
dwc_otg_clear_hcint(sc, x);
- return (1); /* done */
+ return 1; /* done */
}
if (x == 0)
- return (0); /* wait */
+ return 0; /* wait */
/* find new disabled channel */
for (x = 1; x != sc->sc_host_ch_max; x++) {
@@ -2234,9 +2234,9 @@
/* set channel */
td->channel = x;
- return (1); /* new channel allocated */
+ return 1; /* new channel allocated */
}
- return (0); /* wait */
+ return 0; /* wait */
}
static uint8_t
@@ -2249,7 +2249,7 @@
DPRINTFN(9, "\n");
if (td->channel < DWC_OTG_MAX_CHANNELS) {
- return (0); /* already allocated */
+ return 0; /* already allocated */
}
/* get pointer to softc */
@@ -2284,9 +2284,9 @@
/* set channel */
td->channel = x;
- return (0); /* allocated */
+ return 0; /* allocated */
}
- return (1); /* busy */
+ return 1; /* busy */
}
static void
@@ -2351,7 +2351,7 @@
uint32_t hcchar;
if (dwc_otg_host_channel_alloc(td))
- return (1); /* busy */
+ return 1; /* busy */
/* get pointer to softc */
sc = DWC_OTG_TD2SC(td);
@@ -2369,12 +2369,12 @@
DPRINTF("CH=%d STALL\n", td->channel);
td->error_stall = 1;
td->error_any = 1;
- return (0); /* complete */
+ return 0; /* complete */
} else if (hcint & HCINT_ERRORS) {
td->errcnt++;
if (td->hcsplt != 0 || td->errcnt >= 3) {
td->error_any = 1;
- return (0); /* complete */
+ return 0; /* complete */
}
}
@@ -2405,7 +2405,7 @@
td->offset += td->tx_bytes;
td->remainder -= td->tx_bytes;
td->toggle = 1;
- return (0); /* complete */
+ return 0; /* complete */
}
break;
case DWC_CHAN_ST_WAIT_S_ANE:
@@ -2439,7 +2439,7 @@
td->offset += td->tx_bytes;
td->remainder -= td->tx_bytes;
td->toggle = 1;
- return (0); /* complete */
+ return 0; /* complete */
}
break;
case DWC_CHAN_ST_TX_PKT_SYNC:
@@ -2447,12 +2447,12 @@
default:
break;
}
- return (1); /* busy */
+ return 1; /* busy */
send_pkt:
if (sizeof(req) != td->remainder) {
td->error_any = 1;
- return (0); /* complete */
+ return 0; /* complete */
}
send_pkt_sync:
@@ -2467,7 +2467,7 @@
/* set state */
td->state = DWC_CHAN_ST_TX_PKT_SYNC;
dwc_otg_host_channel_free(td);
- return (1); /* busy */
+ return 1; /* busy */
}
td->hcsplt &= ~HCSPLT_COMPSPLT;
@@ -2500,7 +2500,7 @@
td->tx_bytes = sizeof(req);
- return (1); /* busy */
+ return 1; /* busy */
send_cpkt:
@@ -2518,7 +2518,7 @@
/* must enable channel before writing data to FIFO */
DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar);
- return (1); /* busy */
+ return 1; /* busy */
}
static uint8_t
@@ -2559,9 +2559,9 @@
td->set_toggle = 0;
td->toggle = 1;
}
- return (0);
+ return 0;
busy:
- return (1);
+ return 1;
}
static uint8_t
@@ -2574,7 +2574,7 @@
uint8_t ep_type;
if (dwc_otg_host_channel_alloc(td))
- return (1); /* busy */
+ return 1; /* busy */
/* get pointer to softc */
sc = DWC_OTG_TD2SC(td);
@@ -2597,13 +2597,13 @@
DPRINTF("CH=%d STALL\n", td->channel);
td->error_stall = 1;
td->error_any = 1;
- return (0); /* complete */
+ return 0; /* complete */
} else if (hcint & HCINT_ERRORS) {
DPRINTF("CH=%d ERROR\n", td->channel);
td->errcnt++;
if (td->hcsplt != 0 || td->errcnt >= 3) {
td->error_any = 1;
- return (0); /* complete */
+ return 0; /* complete */
}
}
@@ -2656,7 +2656,7 @@
/* release FIFO */
dwc_otg_common_rx_ack(sc);
- return (0); /* we are complete */
+ return 0; /* we are complete */
}
}
@@ -2667,7 +2667,7 @@
/* release FIFO */
dwc_otg_common_rx_ack(sc);
- return (0); /* we are complete */
+ return 0; /* we are complete */
}
usbd_copy_in(td->buf, td->offset,
@@ -2722,7 +2722,7 @@
/* check if we are complete */
if ((td->remainder == 0) || (td->got_short != 0)) {
if (td->short_pkt)
- return (0); /* complete */
+ return 0; /* complete */
/*
* Else need to receive a zero length
@@ -2866,7 +2866,7 @@
DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar);
busy:
- return (1); /* busy */
+ return 1; /* busy */
}
@@ -2880,7 +2880,7 @@
uint8_t ep_type;
if (dwc_otg_host_channel_alloc(td))
- return (1); /* busy */
+ return 1; /* busy */
/* get pointer to softc */
Home |
Main Index |
Thread Index |
Old Index