summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2011-11-12 08:16:45 +0000
committerhselasky <hselasky@FreeBSD.org>2011-11-12 08:16:45 +0000
commita3f67b08f33f8f52dd06e9f36da9671affa61bbd (patch)
tree587db003358056e234b1079f0015b7213b7202ec /sys/dev/usb/controller
parent3b996bbc1149552d433105f70b0d45df8873ed70 (diff)
downloadFreeBSD-src-a3f67b08f33f8f52dd06e9f36da9671affa61bbd.zip
FreeBSD-src-a3f67b08f33f8f52dd06e9f36da9671affa61bbd.tar.gz
Style change.
- Make it easier to port the USB code to other platforms by only using one set of memory functions for clearing and copying memory. None of the memory copies are overlapping. This means using bcopy() is not required. - Fix a compile warning when USB_HAVE_BUSDMA=0 - Add missing semicolon in avr32dci. - Update some comments. MFC after: 1 week
Diffstat (limited to 'sys/dev/usb/controller')
-rw-r--r--sys/dev/usb/controller/at91dci.c2
-rw-r--r--sys/dev/usb/controller/avr32dci.c13
-rw-r--r--sys/dev/usb/controller/ehci.c2
-rw-r--r--sys/dev/usb/controller/ohci.c2
-rw-r--r--sys/dev/usb/controller/uhci.c2
5 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/usb/controller/at91dci.c b/sys/dev/usb/controller/at91dci.c
index 660900b..f831115 100644
--- a/sys/dev/usb/controller/at91dci.c
+++ b/sys/dev/usb/controller/at91dci.c
@@ -2123,7 +2123,7 @@ tr_handle_get_port_status:
if (sc->sc_flags.status_vbus &&
sc->sc_flags.status_bus_reset) {
/* reset endpoint flags */
- bzero(sc->sc_ep_flags, sizeof(sc->sc_ep_flags));
+ memset(sc->sc_ep_flags, 0, sizeof(sc->sc_ep_flags));
}
}
if (sc->sc_flags.change_suspend) {
diff --git a/sys/dev/usb/controller/avr32dci.c b/sys/dev/usb/controller/avr32dci.c
index f7c4dec..26785a3 100644
--- a/sys/dev/usb/controller/avr32dci.c
+++ b/sys/dev/usb/controller/avr32dci.c
@@ -415,12 +415,11 @@ repeat:
buf_res.length = count;
}
/* receive data */
- bcopy(sc->physdata +
+ memcpy(buf_res.buffer, sc->physdata +
(AVR32_EPTSTA_CURRENT_BANK(temp) << td->bank_shift) +
- (td->ep_no << 16) + (td->offset % td->max_packet_size),
- buf_res.buffer, buf_res.length)
+ (td->ep_no << 16) + (td->offset % td->max_packet_size), buf_res.length);
/* update counters */
- count -= buf_res.length;
+ count -= buf_res.length;
td->offset += buf_res.length;
td->remainder -= buf_res.length;
}
@@ -491,12 +490,12 @@ repeat:
buf_res.length = count;
}
/* transmit data */
- bcopy(buf_res.buffer, sc->physdata +
+ memcpy(sc->physdata +
(AVR32_EPTSTA_CURRENT_BANK(temp) << td->bank_shift) +
(td->ep_no << 16) + (td->offset % td->max_packet_size),
- buf_res.length)
+ buf_res.buffer, buf_res.length);
/* update counters */
- count -= buf_res.length;
+ count -= buf_res.length;
td->offset += buf_res.length;
td->remainder -= buf_res.length;
}
diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c
index e10bf14..7e682f4 100644
--- a/sys/dev/usb/controller/ehci.c
+++ b/sys/dev/usb/controller/ehci.c
@@ -3369,7 +3369,7 @@ ehci_roothub_exec(struct usb_device *udev,
break;
case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE):
len = 16;
- bzero(sc->sc_hub_desc.temp, 16);
+ memset(sc->sc_hub_desc.temp, 0, 16);
break;
case C(UR_GET_STATUS, UT_READ_CLASS_OTHER):
DPRINTFN(9, "get port status i=%d\n",
diff --git a/sys/dev/usb/controller/ohci.c b/sys/dev/usb/controller/ohci.c
index 97d505a..fa2d607 100644
--- a/sys/dev/usb/controller/ohci.c
+++ b/sys/dev/usb/controller/ohci.c
@@ -2347,7 +2347,7 @@ ohci_roothub_exec(struct usb_device *udev,
case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE):
len = 16;
- bzero(sc->sc_hub_desc.temp, 16);
+ memset(sc->sc_hub_desc.temp, 0, 16);
break;
case C(UR_GET_STATUS, UT_READ_CLASS_OTHER):
DPRINTFN(9, "get port status i=%d\n",
diff --git a/sys/dev/usb/controller/uhci.c b/sys/dev/usb/controller/uhci.c
index e6559ec..c365e01 100644
--- a/sys/dev/usb/controller/uhci.c
+++ b/sys/dev/usb/controller/uhci.c
@@ -2702,7 +2702,7 @@ uhci_roothub_exec(struct usb_device *udev,
break;
case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE):
len = 16;
- bzero(sc->sc_hub_desc.temp, 16);
+ memset(sc->sc_hub_desc.temp, 0, 16);
break;
case C(UR_GET_STATUS, UT_READ_CLASS_OTHER):
if (index == 1)
OpenPOWER on IntegriCloud