aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2013-07-29 05:39:20 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2013-07-29 05:39:20 +0000
commit3e506f5f8c0fa0c13668aca2dcf91a6cc2802aa8 (patch)
tree16bd3a7b540cdba2a1a97c3780744b08b81d652f /sys/dev
parent4b5ef056f1edeb2cbce0335678c5ec7814a32dfc (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/wi/if_wi.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 2ca3c8cf8fa1..c9bf2e069b16 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -1905,8 +1905,7 @@ wi_seek_bap(struct wi_softc *sc, int id, int off)
static int
wi_read_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen)
{
- u_int16_t *ptr;
- int i, error, cnt;
+ int error, cnt;
if (buflen == 0)
return 0;
@@ -1915,9 +1914,7 @@ wi_read_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen)
return error;
}
cnt = (buflen + 1) / 2;
- ptr = (u_int16_t *)buf;
- for (i = 0; i < cnt; i++)
- *ptr++ = CSR_READ_2(sc, WI_DATA0);
+ CSR_READ_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt);
sc->sc_bap_off += cnt * 2;
return 0;
}
@@ -1925,8 +1922,7 @@ wi_read_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen)
static int
wi_write_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen)
{
- u_int16_t *ptr;
- int i, error, cnt;
+ int error, cnt;
if (buflen == 0)
return 0;
@@ -1936,9 +1932,7 @@ wi_write_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen)
return error;
}
cnt = (buflen + 1) / 2;
- ptr = (u_int16_t *)buf;
- for (i = 0; i < cnt; i++)
- CSR_WRITE_2(sc, WI_DATA0, ptr[i]);
+ CSR_WRITE_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt);
sc->sc_bap_off += cnt * 2;
return 0;