summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_busdma.c
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/usb_busdma.c
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/usb_busdma.c')
-rw-r--r--sys/dev/usb/usb_busdma.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/usb/usb_busdma.c b/sys/dev/usb/usb_busdma.c
index f550dd0..d31aeec 100644
--- a/sys/dev/usb/usb_busdma.c
+++ b/sys/dev/usb/usb_busdma.c
@@ -80,9 +80,9 @@ void
usbd_get_page(struct usb_page_cache *pc, usb_frlength_t offset,
struct usb_page_search *res)
{
+#if USB_HAVE_BUSDMA
struct usb_page *page;
-#if USB_HAVE_BUSDMA
if (pc->page_start) {
/* Case 1 - something has been loaded into DMA */
@@ -145,7 +145,7 @@ usbd_copy_in(struct usb_page_cache *cache, usb_frlength_t offset,
if (buf_res.length > len) {
buf_res.length = len;
}
- bcopy(ptr, buf_res.buffer, buf_res.length);
+ memcpy(buf_res.buffer, ptr, buf_res.length);
offset += buf_res.length;
len -= buf_res.length;
@@ -267,7 +267,7 @@ usbd_copy_out(struct usb_page_cache *cache, usb_frlength_t offset,
if (res.length > len) {
res.length = len;
}
- bcopy(res.buffer, ptr, res.length);
+ memcpy(ptr, res.buffer, res.length);
offset += res.length;
len -= res.length;
@@ -325,7 +325,7 @@ usbd_frame_zero(struct usb_page_cache *cache, usb_frlength_t offset,
if (res.length > len) {
res.length = len;
}
- bzero(res.buffer, res.length);
+ memset(res.buffer, 0, res.length);
offset += res.length;
len -= res.length;
@@ -560,7 +560,7 @@ usb_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg,
bus_dmamem_free(utag->tag, ptr, map);
goto error;
}
- bzero(ptr, size);
+ memset(ptr, 0, size);
usb_pc_cpu_flush(pc);
@@ -797,7 +797,7 @@ usb_dma_tag_setup(struct usb_dma_parent_tag *udpt,
struct mtx *mtx, usb_dma_callback_t *func,
uint8_t ndmabits, uint8_t nudt)
{
- bzero(udpt, sizeof(*udpt));
+ memset(udpt, 0, sizeof(*udpt));
/* sanity checking */
if ((nudt == 0) ||
@@ -818,7 +818,7 @@ usb_dma_tag_setup(struct usb_dma_parent_tag *udpt,
udpt->dma_bits = ndmabits;
while (nudt--) {
- bzero(udt, sizeof(*udt));
+ memset(udt, 0, sizeof(*udt));
udt->tag_parent = udpt;
udt++;
}
OpenPOWER on IntegriCloud