diff options
| author | Pyun YongHyeon <yongari@FreeBSD.org> | 2010-08-23 21:40:03 +0000 |
|---|---|---|
| committer | Pyun YongHyeon <yongari@FreeBSD.org> | 2010-08-23 21:40:03 +0000 |
| commit | 820b53e152b542f5c6b4bd1f3c7f1b7ae1e9a7c7 (patch) | |
| tree | 1def6cd70da41d1b05f5747f8aeeff6360282d88 /sys/dev/ed | |
| parent | 9ae11bbaa6e055710030e98f5bbccd48e4520175 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ed')
| -rw-r--r-- | sys/dev/ed/if_ed.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 839e2a52cc99..6213ce763d7e 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -1476,9 +1476,12 @@ ed_pio_write_mbufs(struct ed_softc *sc, struct mbuf *m, bus_size_t dst) } } else { /* NE2000s are a pain */ - unsigned char *data; + uint8_t *data; int len, wantbyte; - unsigned char savebyte[2]; + union { + uint16_t w; + uint8_t b[2]; + } saveword; wantbyte = 0; @@ -1488,9 +1491,9 @@ ed_pio_write_mbufs(struct ed_softc *sc, struct mbuf *m, bus_size_t dst) data = mtod(m, caddr_t); /* finish the last word */ if (wantbyte) { - savebyte[1] = *data; + saveword.b[1] = *data; ed_asic_outw(sc, ED_NOVELL_DATA, - *(u_short *)savebyte); + saveword.w); data++; len--; wantbyte = 0; @@ -1504,7 +1507,7 @@ ed_pio_write_mbufs(struct ed_softc *sc, struct mbuf *m, bus_size_t dst) } /* save last byte, if necessary */ if (len == 1) { - savebyte[0] = *data; + saveword.b[0] = *data; wantbyte = 1; } } @@ -1512,7 +1515,7 @@ ed_pio_write_mbufs(struct ed_softc *sc, struct mbuf *m, bus_size_t dst) } /* spit last byte */ if (wantbyte) - ed_asic_outw(sc, ED_NOVELL_DATA, *(u_short *)savebyte); + ed_asic_outw(sc, ED_NOVELL_DATA, saveword.w); } /* |
