Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb - use uint8_t for xfer buffers and byte numbers



details:   https://anonhg.NetBSD.org/src/rev/68e1a36bda5e
branches:  trunk
changeset: 757091:68e1a36bda5e
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Aug 14 10:47:57 2010 +0000

description:
- use uint8_t for xfer buffers and byte numbers
- use bool for sc_dying and sc_attached booleans

diffstat:

 sys/dev/usb/if_axe.c    |  14 +++++++-------
 sys/dev/usb/if_axereg.h |  12 ++++++------
 2 files changed, 13 insertions(+), 13 deletions(-)

diffs (103 lines):

diff -r 676ddca7ad66 -r 68e1a36bda5e sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c      Sat Aug 14 10:39:33 2010 +0000
+++ b/sys/dev/usb/if_axe.c      Sat Aug 14 10:47:57 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axe.c,v 1.44 2010/08/14 10:30:11 tsutsui Exp $      */
+/*     $NetBSD: if_axe.c,v 1.45 2010/08/14 10:47:57 tsutsui Exp $      */
 /*     $OpenBSD: if_axe.c,v 1.96 2010/01/09 05:33:08 jsg Exp $ */
 
 /*
@@ -89,7 +89,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.44 2010/08/14 10:30:11 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.45 2010/08/14 10:47:57 tsutsui Exp $");
 
 #if defined(__NetBSD__)
 #include "opt_inet.h"
@@ -732,7 +732,7 @@
        callout_init(&sc->axe_stat_ch, 0);
        callout_setfunc(&sc->axe_stat_ch, axe_tick, sc);
 
-       sc->axe_attached = 1;
+       sc->axe_attached = true;
        splx(s);
 
        usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->axe_udev, sc->axe_dev);
@@ -751,7 +751,7 @@
        if (!sc->axe_attached)
                return 0;
 
-       sc->axe_dying = 1;
+       sc->axe_dying = true;
 
        /*
         * Remove any pending tasks.  They cannot be executing because they run
@@ -781,7 +781,7 @@
                aprint_debug_dev(self, "detach has active endpoints\n");
 #endif
 
-       sc->axe_attached = 0;
+       sc->axe_attached = false;
 
        if (--sc->axe_refcnt >= 0) {
                /* Wait for processes to go away. */
@@ -804,7 +804,7 @@
        switch (act) {
        case DVACT_DEACTIVATE:
                if_deactivate(&sc->axe_ec.ec_if);
-               sc->axe_dying = 1;
+               sc->axe_dying = true;
                return 0;
        default:
                return EOPNOTSUPP;
@@ -965,7 +965,7 @@
                m->m_pkthdr.rcvif = ifp;
                m->m_pkthdr.len = m->m_len = pktlen;
 
-               memcpy(mtod(m, char *), buf, pktlen);
+               memcpy(mtod(m, uint8_t *), buf, pktlen);
                buf += rxlen;
 
                s = splnet();
diff -r 676ddca7ad66 -r 68e1a36bda5e sys/dev/usb/if_axereg.h
--- a/sys/dev/usb/if_axereg.h   Sat Aug 14 10:39:33 2010 +0000
+++ b/sys/dev/usb/if_axereg.h   Sat Aug 14 10:47:57 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axereg.h,v 1.11 2010/08/14 10:30:11 tsutsui Exp $   */
+/*     $NetBSD: if_axereg.h,v 1.12 2010/08/14 10:47:57 tsutsui Exp $   */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003
@@ -176,7 +176,7 @@
 struct axe_chain {
        struct axe_softc        *axe_sc;
        usbd_xfer_handle        axe_xfer;
-       char                    *axe_buf;
+       uint8_t                 *axe_buf;
        int                     axe_accum;
        int                     axe_idx;
 };
@@ -216,8 +216,8 @@
        struct callout axe_stat_ch;
 
        int                     axe_refcnt;
-       char                    axe_dying;
-       char                    axe_attached;
+       bool                    axe_dying;
+       bool                    axe_attached;
 
        struct usb_task         axe_tick_task;
 
@@ -225,8 +225,8 @@
 
        int                     axe_link;
 
-       unsigned char           axe_ipgs[3];
-       unsigned char           axe_phyaddrs[2];
+       uint8_t                 axe_ipgs[3];
+       uint8_t                 axe_phyaddrs[2];
        struct timeval          axe_rx_notice;
        int                     axe_bufsz;
 



Home | Main Index | Thread Index | Old Index