Author: hselasky
Date: Fri May  4 15:05:30 2012
New Revision: 235000
URL: http://svn.freebsd.org/changeset/base/235000

Log:
  MFC r233774:
  Fix compiler warnings, mostly signed issues,
  when USB modules are compiled with WARNS=9.

Modified:
  stable/9/sys/dev/sound/usb/uaudio.c
  stable/9/sys/dev/sound/usb/uaudioreg.h
  stable/9/sys/dev/usb/controller/at91dci.c
  stable/9/sys/dev/usb/controller/atmegadci.c
  stable/9/sys/dev/usb/controller/avr32dci.c
  stable/9/sys/dev/usb/controller/ehci.c
  stable/9/sys/dev/usb/controller/musb_otg.c
  stable/9/sys/dev/usb/controller/ohci.c
  stable/9/sys/dev/usb/controller/uhci.c
  stable/9/sys/dev/usb/controller/uss820dci.c
  stable/9/sys/dev/usb/controller/xhci.c
  stable/9/sys/dev/usb/input/atp.c
  stable/9/sys/dev/usb/input/uep.c
  stable/9/sys/dev/usb/input/uhid.c
  stable/9/sys/dev/usb/input/ukbd.c
  stable/9/sys/dev/usb/input/ums.c
  stable/9/sys/dev/usb/misc/ufm.c
  stable/9/sys/dev/usb/net/if_aue.c
  stable/9/sys/dev/usb/net/if_axe.c
  stable/9/sys/dev/usb/net/if_cdce.c
  stable/9/sys/dev/usb/net/if_cue.c
  stable/9/sys/dev/usb/net/if_ipheth.c
  stable/9/sys/dev/usb/net/if_kue.c
  stable/9/sys/dev/usb/net/if_rue.c
  stable/9/sys/dev/usb/net/if_udav.c
  stable/9/sys/dev/usb/net/if_usie.c
  stable/9/sys/dev/usb/net/ruephy.c
  stable/9/sys/dev/usb/net/uhso.c
  stable/9/sys/dev/usb/serial/ubsa.c
  stable/9/sys/dev/usb/serial/uchcom.c
  stable/9/sys/dev/usb/serial/ucycom.c
  stable/9/sys/dev/usb/serial/ufoma.c
  stable/9/sys/dev/usb/serial/ulpt.c
  stable/9/sys/dev/usb/serial/umodem.c
  stable/9/sys/dev/usb/serial/uplcom.c
  stable/9/sys/dev/usb/serial/usb_serial.c
  stable/9/sys/dev/usb/serial/usb_serial.h
  stable/9/sys/dev/usb/storage/umass.c
  stable/9/sys/dev/usb/storage/urio.c
  stable/9/sys/dev/usb/storage/ustorage_fs.c
  stable/9/sys/dev/usb/template/usb_template.c
  stable/9/sys/dev/usb/usb_busdma.c
  stable/9/sys/dev/usb/usb_compat_linux.c
  stable/9/sys/dev/usb/usb_dev.c
  stable/9/sys/dev/usb/usb_device.c
  stable/9/sys/dev/usb/usb_handle_request.c
  stable/9/sys/dev/usb/usb_hid.c
  stable/9/sys/dev/usb/usb_hub.c
  stable/9/sys/dev/usb/usb_msctest.c
  stable/9/sys/dev/usb/usb_request.c
  stable/9/sys/dev/usb/usb_transfer.c
  stable/9/sys/dev/usb/usbdi.h
  stable/9/sys/dev/usb/usbhid.h
  stable/9/sys/dev/usb/wlan/if_rum.c
  stable/9/sys/dev/usb/wlan/if_run.c
  stable/9/sys/dev/usb/wlan/if_uath.c
  stable/9/sys/dev/usb/wlan/if_upgt.c
  stable/9/sys/dev/usb/wlan/if_ural.c
  stable/9/sys/dev/usb/wlan/if_urtw.c
  stable/9/sys/dev/usb/wlan/if_zyd.c
  stable/9/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/sound/usb/uaudio.c
==============================================================================
--- stable/9/sys/dev/sound/usb/uaudio.c Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/sound/usb/uaudio.c Fri May  4 15:05:30 2012        
(r235000)
@@ -1272,15 +1272,15 @@ uaudio_chan_record_callback(struct usb_x
 {
        struct uaudio_chan *ch = usbd_xfer_softc(xfer);
        struct usb_page_cache *pc;
-       uint32_t n;
-       uint32_t m;
-       uint32_t blockcount;
        uint32_t offset0;
        uint32_t offset1;
        uint32_t mfl;
+       int m;
+       int n;
        int len;
        int actlen;
        int nframes;
+       int blockcount;
 
        usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes);
        mfl = usbd_xfer_max_framelen(xfer);
@@ -1307,9 +1307,9 @@ uaudio_chan_record_callback(struct usb_x
 
                                m = (ch->end - ch->cur);
 
-                               if (m > len) {
+                               if (m > len)
                                        m = len;
-                               }
+
                                usbd_copy_out(pc, offset1, ch->cur, m);
 
                                len -= m;
@@ -1884,10 +1884,10 @@ uaudio_mixer_add_selector(struct uaudio_
 
 static uint32_t
 uaudio_mixer_feature_get_bmaControls(const struct usb_audio_feature_unit *d,
-    uint8_t index)
+    uint8_t i)
 {
        uint32_t temp = 0;
-       uint32_t offset = (index * d->bControlSize);
+       uint32_t offset = (i * d->bControlSize);
 
        if (d->bControlSize > 0) {
                temp |= d->bmaControls[offset];
@@ -2636,8 +2636,8 @@ uaudio_mixer_feature_name(const struct u
        return (uat->feature);
 }
 
-const static struct uaudio_terminal_node *
-uaudio_mixer_get_input(const struct uaudio_terminal_node *iot, uint8_t index)
+static const struct uaudio_terminal_node *
+uaudio_mixer_get_input(const struct uaudio_terminal_node *iot, uint8_t i)
 {
        struct uaudio_terminal_node *root = iot->root;
        uint8_t n;
@@ -2645,17 +2645,16 @@ uaudio_mixer_get_input(const struct uaud
        n = iot->usr.id_max;
        do {
                if (iot->usr.bit_input[n / 8] & (1 << (n % 8))) {
-                       if (!index--) {
+                       if (!i--)
                                return (root + n);
-                       }
                }
        } while (n--);
 
        return (NULL);
 }
 
-const static struct uaudio_terminal_node *
-uaudio_mixer_get_output(const struct uaudio_terminal_node *iot, uint8_t index)
+static const struct uaudio_terminal_node *
+uaudio_mixer_get_output(const struct uaudio_terminal_node *iot, uint8_t i)
 {
        struct uaudio_terminal_node *root = iot->root;
        uint8_t n;
@@ -2663,9 +2662,8 @@ uaudio_mixer_get_output(const struct uau
        n = iot->usr.id_max;
        do {
                if (iot->usr.bit_output[n / 8] & (1 << (n % 8))) {
-                       if (!index--) {
+                       if (!i--)
                                return (root + n);
-                       }
                }
        } while (n--);
 

Modified: stable/9/sys/dev/sound/usb/uaudioreg.h
==============================================================================
--- stable/9/sys/dev/sound/usb/uaudioreg.h      Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/sound/usb/uaudioreg.h      Fri May  4 15:05:30 2012        
(r235000)
@@ -113,9 +113,9 @@ struct usb_audio_streaming_type1_descrip
        uByte   bSamFreqType;
 #define        UA_SAMP_CONTNUOUS 0
        uByte   tSamFreq[0];
-#define        UA_GETSAMP(p, n) (((p)->tSamFreq[((n)*3)+0]) |      \
+#define        UA_GETSAMP(p, n) ((uint32_t)((((p)->tSamFreq[((n)*3)+0]) | \
                          ((p)->tSamFreq[((n)*3)+1] << 8) | \
-                         ((p)->tSamFreq[((n)*3)+2] << 16))
+                         ((p)->tSamFreq[((n)*3)+2] << 16))))
 #define        UA_SAMP_LO(p) UA_GETSAMP(p, 0)
 #define        UA_SAMP_HI(p) UA_GETSAMP(p, 1)
 } __packed;

Modified: stable/9/sys/dev/usb/controller/at91dci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/at91dci.c   Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/controller/at91dci.c   Fri May  4 15:05:30 2012        
(r235000)
@@ -1725,14 +1725,13 @@ static const struct at91dci_config_desc 
        },
 };
 
+#define        HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) }
+
 static const struct usb_hub_descriptor_min at91dci_hubd = {
        .bDescLength = sizeof(at91dci_hubd),
        .bDescriptorType = UDESC_HUB,
        .bNbrPorts = 1,
-       .wHubCharacteristics[0] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF,
-       .wHubCharacteristics[1] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8,
+       HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)),
        .bPwrOn2PwrGood = 50,
        .bHubContrCurrent = 0,
        .DeviceRemovable = {0},         /* port is removable */

Modified: stable/9/sys/dev/usb/controller/atmegadci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/atmegadci.c Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/controller/atmegadci.c Fri May  4 15:05:30 2012        
(r235000)
@@ -1547,14 +1547,13 @@ static const struct atmegadci_config_des
        },
 };
 
+#define        HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) }
+
 static const struct usb_hub_descriptor_min atmegadci_hubd = {
        .bDescLength = sizeof(atmegadci_hubd),
        .bDescriptorType = UDESC_HUB,
        .bNbrPorts = 1,
-       .wHubCharacteristics[0] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF,
-       .wHubCharacteristics[1] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8,
+       HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)),
        .bPwrOn2PwrGood = 50,
        .bHubContrCurrent = 0,
        .DeviceRemovable = {0},         /* port is removable */

Modified: stable/9/sys/dev/usb/controller/avr32dci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/avr32dci.c  Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/controller/avr32dci.c  Fri May  4 15:05:30 2012        
(r235000)
@@ -1489,14 +1489,13 @@ static const struct avr32dci_config_desc
        },
 };
 
+#define        HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) }
+
 static const struct usb_hub_descriptor_min avr32dci_hubd = {
        .bDescLength = sizeof(avr32dci_hubd),
        .bDescriptorType = UDESC_HUB,
        .bNbrPorts = 1,
-       .wHubCharacteristics[0] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF,
-       .wHubCharacteristics[1] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8,
+       HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)),
        .bPwrOn2PwrGood = 50,
        .bHubContrCurrent = 0,
        .DeviceRemovable = {0},         /* port is removable */

Modified: stable/9/sys/dev/usb/controller/ehci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/ehci.c      Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/controller/ehci.c      Fri May  4 15:05:30 2012        
(r235000)
@@ -3011,13 +3011,8 @@ static const struct ehci_config_desc ehc
 static const
 struct usb_hub_descriptor ehci_hubd =
 {
-       0,                              /* dynamic length */
-       UDESC_HUB,
-       0,
-       {0, 0},
-       0,
-       0,
-       {0},
+       .bDescLength = 0,               /* dynamic length */
+       .bDescriptorType = UDESC_HUB,
 };
 
 static void

Modified: stable/9/sys/dev/usb/controller/musb_otg.c
==============================================================================
--- stable/9/sys/dev/usb/controller/musb_otg.c  Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/controller/musb_otg.c  Fri May  4 15:05:30 2012        
(r235000)
@@ -2192,14 +2192,13 @@ static const struct musbotg_config_desc 
        },
 };
 
+#define        HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) }
+
 static const struct usb_hub_descriptor_min musbotg_hubd = {
        .bDescLength = sizeof(musbotg_hubd),
        .bDescriptorType = UDESC_HUB,
        .bNbrPorts = 1,
-       .wHubCharacteristics[0] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF,
-       .wHubCharacteristics[1] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 16,
+       HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)),
        .bPwrOn2PwrGood = 50,
        .bHubContrCurrent = 0,
        .DeviceRemovable = {0},         /* port is removable */

Modified: stable/9/sys/dev/usb/controller/ohci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/ohci.c      Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/controller/ohci.c      Fri May  4 15:05:30 2012        
(r235000)
@@ -2080,13 +2080,8 @@ struct ohci_config_desc ohci_confd =
 static const
 struct usb_hub_descriptor ohci_hubd =
 {
-       0,                              /* dynamic length */
-       UDESC_HUB,
-       0,
-       {0, 0},
-       0,
-       0,
-       {0},
+       .bDescLength = 0,       /* dynamic length */
+       .bDescriptorType = UDESC_HUB,
 };
 
 static usb_error_t

Modified: stable/9/sys/dev/usb/controller/uhci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/uhci.c      Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/controller/uhci.c      Fri May  4 15:05:30 2012        
(r235000)
@@ -2351,13 +2351,11 @@ static const struct uhci_config_desc uhc
 static const
 struct usb_hub_descriptor_min uhci_hubd_piix =
 {
-       sizeof(uhci_hubd_piix),
-       UDESC_HUB,
-       2,
-       {UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL, 0},
-       50,                             /* power on to power good */
-       0,
-       {0x00},                         /* both ports are removable */
+       .bDescLength = sizeof(uhci_hubd_piix),
+       .bDescriptorType = UDESC_HUB,
+       .bNbrPorts = 2,
+       .wHubCharacteristics = {UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL, 0},
+       .bPwrOn2PwrGood = 50,
 };
 
 /*

Modified: stable/9/sys/dev/usb/controller/uss820dci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/uss820dci.c Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/controller/uss820dci.c Fri May  4 15:05:30 2012        
(r235000)
@@ -1788,14 +1788,13 @@ static const struct uss820dci_config_des
        },
 };
 
+#define        HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) }
+
 static const struct usb_hub_descriptor_min uss820dci_hubd = {
        .bDescLength = sizeof(uss820dci_hubd),
        .bDescriptorType = UDESC_HUB,
        .bNbrPorts = 1,
-       .wHubCharacteristics[0] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) & 0xFF,
-       .wHubCharacteristics[1] =
-       (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL) >> 8,
+       HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)),
        .bPwrOn2PwrGood = 50,
        .bHubContrCurrent = 0,
        .DeviceRemovable = {0},         /* port is removable */

Modified: stable/9/sys/dev/usb/controller/xhci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/xhci.c      Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/controller/xhci.c      Fri May  4 15:05:30 2012        
(r235000)
@@ -821,7 +821,7 @@ xhci_check_transfer(struct xhci_softc *s
                offset = td_event - td->td_self;
 
                if (offset >= 0 &&
-                   offset < sizeof(td->td_trb)) {
+                   offset < (int64_t)sizeof(td->td_trb)) {
 
                        usb_pc_cpu_invalidate(td->page_cache);
 
@@ -2805,7 +2805,7 @@ struct usb_pipe_methods xhci_device_gene
  * Simulate a hardware HUB by handling all the necessary requests.
  *------------------------------------------------------------------------*/
 
-#define        HSETW(ptr, val) ptr[0] = (uint8_t)(val), ptr[1] = 
(uint8_t)((val) >> 8)
+#define        HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) }
 
 static const
 struct usb_device_descriptor xhci_devd =
@@ -2848,8 +2848,7 @@ struct xhci_bos_desc xhci_bosd = {
                HSETW(.wSpeedsSupported, 0x000C),
                .bFunctionalitySupport = 8,
                .bU1DevExitLat = 255,   /* dummy - not used */
-               .wU2DevExitLat[0] = 0x00,
-               .wU2DevExitLat[1] = 0x08,
+               .wU2DevExitLat = { 0x00, 0x08 },
        },
        .cidd = {
                .bLength = sizeof(xhci_bosd.cidd),

Modified: stable/9/sys/dev/usb/input/atp.c
==============================================================================
--- stable/9/sys/dev/usb/input/atp.c    Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/input/atp.c    Fri May  4 15:05:30 2012        
(r235000)
@@ -761,7 +761,7 @@ atp_get_pressures(int *p, const int *cur
                 * threshold; this will reduce the contribution from
                 * lower pressure readings.
                 */
-               if (p[i] <= atp_sensor_noise_threshold)
+               if ((u_int)p[i] <= atp_sensor_noise_threshold)
                        p[i] = 0; /* filter away noise */
                else
                        p[i] -= atp_sensor_noise_threshold;
@@ -887,7 +887,7 @@ atp_match_stroke_component(atp_stroke_co
 
        delta_mickeys = pspan->loc - component->loc;
 
-       if (abs(delta_mickeys) > atp_max_delta_mickeys)
+       if ((u_int)abs(delta_mickeys) > atp_max_delta_mickeys)
                return (FALSE); /* the finger span is too far out; no match */
 
        component->loc          = pspan->loc;
@@ -1164,9 +1164,10 @@ static void
 atp_add_new_strokes(struct atp_softc *sc, atp_pspan *pspans_x,
     u_int n_xpspans, atp_pspan *pspans_y, u_int n_ypspans)
 {
-       int       i, j;
        atp_pspan spans[2][ATP_MAX_PSPANS_PER_AXIS];
-       u_int     nspans[2];
+       u_int nspans[2];
+       u_int i;
+       u_int j;
 
        /* Copy unmatched pspans into the local arrays. */
        for (i = 0, nspans[X] = 0; i < n_xpspans; i++) {
@@ -1373,9 +1374,9 @@ atp_terminate_stroke(struct atp_softc *s
 static __inline boolean_t
 atp_stroke_has_small_movement(const atp_stroke *stroke)
 {
-       return ((abs(stroke->components[X].delta_mickeys) <=
+       return (((u_int)abs(stroke->components[X].delta_mickeys) <=
                atp_small_movement_threshold) &&
-           (abs(stroke->components[Y].delta_mickeys) <=
+           ((u_int)abs(stroke->components[Y].delta_mickeys) <=
                atp_small_movement_threshold));
 }
 
@@ -1388,7 +1389,7 @@ static __inline void
 atp_update_pending_mickeys(atp_stroke_component *component)
 {
        component->pending += component->delta_mickeys;
-       if (abs(component->pending) <= atp_small_movement_threshold)
+       if ((u_int)abs(component->pending) <= atp_small_movement_threshold)
                component->delta_mickeys = 0;
        else {
                /*
@@ -1690,7 +1691,7 @@ atp_attach(device_t dev)
 
        if (usb_fifo_attach(sc->sc_usb_device, sc, &sc->sc_mutex,
                &atp_fifo_methods, &sc->sc_fifo,
-               device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex,
+               device_get_unit(dev), -1, uaa->info.bIfaceIndex,
                UID_ROOT, GID_OPERATOR, 0644)) {
                goto detach;
        }
@@ -1764,13 +1765,13 @@ atp_intr(struct usb_xfer *xfer, usb_erro
 
        switch (USB_GET_STATE(xfer)) {
        case USB_ST_TRANSFERRED:
-               if (len > sc->sc_params->data_len) {
+               if (len > (int)sc->sc_params->data_len) {
                        DPRINTFN(ATP_LLEVEL_ERROR,
                            "truncating large packet from %u to %u bytes\n",
                            len, sc->sc_params->data_len);
                        len = sc->sc_params->data_len;
                }
-               if (len < sc->sc_params->data_len)
+               if (len < (int)sc->sc_params->data_len)
                        goto tr_setup;
 
                pc = usbd_xfer_get_frame(xfer, 0);
@@ -2213,9 +2214,9 @@ static device_method_t atp_methods[] = {
 };
 
 static driver_t atp_driver = {
-       ATP_DRIVER_NAME,
-       atp_methods,
-       sizeof(struct atp_softc)
+       .name = ATP_DRIVER_NAME,
+       .methods = atp_methods,
+       .size = sizeof(struct atp_softc)
 };
 
 static devclass_t atp_devclass;

Modified: stable/9/sys/dev/usb/input/uep.c
==============================================================================
--- stable/9/sys/dev/usb/input/uep.c    Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/input/uep.c    Fri May  4 15:05:30 2012        
(r235000)
@@ -202,7 +202,7 @@ uep_intr_callback(struct usb_xfer *xfer,
                u_char buf[17], *p;
                int pkt_len;
 
-               if (len > sizeof(buf)) {
+               if (len > (int)sizeof(buf)) {
                        DPRINTF("bad input length %d\n", len);
                        goto tr_setup;
                }
@@ -329,7 +329,7 @@ uep_attach(device_t dev)
        }
 
        error = usb_fifo_attach(uaa->device, sc, &sc->mtx, &uep_fifo_methods,
-           &sc->fifo, device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex,
+           &sc->fifo, device_get_unit(dev), -1, uaa->info.bIfaceIndex,
            UID_ROOT, GID_OPERATOR, 0644);
 
         if (error) {

Modified: stable/9/sys/dev/usb/input/uhid.c
==============================================================================
--- stable/9/sys/dev/usb/input/uhid.c   Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/input/uhid.c   Fri May  4 15:05:30 2012        
(r235000)
@@ -170,10 +170,10 @@ uhid_intr_callback(struct usb_xfer *xfer
                 * If the ID byte is non zero we allow descriptors
                 * having multiple sizes:
                 */
-               if ((actlen >= sc->sc_isize) ||
+               if ((actlen >= (int)sc->sc_isize) ||
                    ((actlen > 0) && (sc->sc_iid != 0))) {
                        /* limit report length to the maximum */
-                       if (actlen > sc->sc_isize)
+                       if (actlen > (int)sc->sc_isize)
                                actlen = sc->sc_isize;
                        usb_fifo_put_data(sc->sc_fifo.fp[USB_FIFO_RX], pc,
                            0, actlen, 1);
@@ -768,7 +768,7 @@ uhid_attach(device_t dev)
 
        error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
            &uhid_fifo_methods, &sc->sc_fifo,
-           unit, 0 - 1, uaa->info.bIfaceIndex,
+           unit, -1, uaa->info.bIfaceIndex,
            UID_ROOT, GID_OPERATOR, 0644);
        if (error) {
                goto detach;

Modified: stable/9/sys/dev/usb/input/ukbd.c
==============================================================================
--- stable/9/sys/dev/usb/input/ukbd.c   Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/input/ukbd.c   Fri May  4 15:05:30 2012        
(r235000)
@@ -2121,7 +2121,7 @@ ukbd_key2scan(struct ukbd_softc *sc, int
                0x5c,   /* Keyboard Intl' 6 (Keypad ,) (For PC-9821 layout) */
        };
 
-       if ((code >= 89) && (code < (89 + (sizeof(scan) / sizeof(scan[0]))))) {
+       if ((code >= 89) && (code < (int)(89 + (sizeof(scan) / 
sizeof(scan[0]))))) {
                code = scan[code - 89];
        }
        /* Pause/Break */

Modified: stable/9/sys/dev/usb/input/ums.c
==============================================================================
--- stable/9/sys/dev/usb/input/ums.c    Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/input/ums.c    Fri May  4 15:05:30 2012        
(r235000)
@@ -201,7 +201,7 @@ ums_intr_callback(struct usb_xfer *xfer,
        case USB_ST_TRANSFERRED:
                DPRINTFN(6, "sc=%p actlen=%d\n", sc, len);
 
-               if (len > sizeof(sc->sc_temp)) {
+               if (len > (int)sizeof(sc->sc_temp)) {
                        DPRINTFN(6, "truncating large packet to %zu bytes\n",
                            sizeof(sc->sc_temp));
                        len = sizeof(sc->sc_temp);
@@ -644,7 +644,7 @@ ums_attach(device_t dev)
                /* Some wheels need the Z axis reversed. */
                info->sc_flags |= UMS_FLAG_REVZ;
        }
-       if (isize > usbd_xfer_max_framelen(sc->sc_xfer[UMS_INTR_DT])) {
+       if (isize > (int)usbd_xfer_max_framelen(sc->sc_xfer[UMS_INTR_DT])) {
                DPRINTF("WARNING: report size, %d bytes, is larger "
                    "than interrupt size, %d bytes!\n", isize,
                    usbd_xfer_max_framelen(sc->sc_xfer[UMS_INTR_DT]));
@@ -698,7 +698,7 @@ ums_attach(device_t dev)
 
        err = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
            &ums_fifo_methods, &sc->sc_fifo,
-           device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex,
+           device_get_unit(dev), -1, uaa->info.bIfaceIndex,
            UID_ROOT, GID_OPERATOR, 0644);
        if (err) {
                goto detach;

Modified: stable/9/sys/dev/usb/misc/ufm.c
==============================================================================
--- stable/9/sys/dev/usb/misc/ufm.c     Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/misc/ufm.c     Fri May  4 15:05:30 2012        
(r235000)
@@ -156,7 +156,7 @@ ufm_attach(device_t dev)
 
        error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
            &ufm_fifo_methods, &sc->sc_fifo,
-           device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex,
+           device_get_unit(dev), -1, uaa->info.bIfaceIndex,
            UID_ROOT, GID_OPERATOR, 0644);
        if (error) {
                goto detach;

Modified: stable/9/sys/dev/usb/net/if_aue.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_aue.c   Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/if_aue.c   Fri May  4 15:05:30 2012        
(r235000)
@@ -740,7 +740,7 @@ aue_intr_callback(struct usb_xfer *xfer,
        case USB_ST_TRANSFERRED:
 
                if ((ifp->if_drv_flags & IFF_DRV_RUNNING) &&
-                   actlen >= sizeof(pkt)) {
+                   actlen >= (int)sizeof(pkt)) {
 
                        pc = usbd_xfer_get_frame(xfer, 0);
                        usbd_copy_out(pc, 0, &pkt, sizeof(pkt));
@@ -793,7 +793,7 @@ aue_bulk_read_callback(struct usb_xfer *
                        }
                } else {
 
-                       if (actlen <= sizeof(stat) + ETHER_CRC_LEN) {
+                       if (actlen <= (int)(sizeof(stat) + ETHER_CRC_LEN)) {
                                ifp->if_ierrors++;
                                goto tr_setup;
                        }

Modified: stable/9/sys/dev/usb/net/if_axe.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_axe.c   Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/if_axe.c   Fri May  4 15:05:30 2012        
(r235000)
@@ -1037,7 +1037,7 @@ axe_rx_frame(struct usb_ether *ue, struc
        error = 0;
        if ((sc->sc_flags & AXE_FLAG_STD_FRAME) != 0) {
                while (pos < actlen) {
-                       if ((pos + sizeof(hdr)) > actlen) {
+                       if ((int)(pos + sizeof(hdr)) > actlen) {
                                /* too little data */
                                error = EINVAL;
                                break;
@@ -1061,7 +1061,7 @@ axe_rx_frame(struct usb_ether *ue, struc
                }
        } else if ((sc->sc_flags & AXE_FLAG_CSUM_FRAME) != 0) {
                while (pos < actlen) {
-                       if ((pos + sizeof(csum_hdr)) > actlen) {
+                       if ((int)(pos + sizeof(csum_hdr)) > actlen) {
                                /* too little data */
                                error = EINVAL;
                                break;

Modified: stable/9/sys/dev/usb/net/if_cdce.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_cdce.c  Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/if_cdce.c  Fri May  4 15:05:30 2012        
(r235000)
@@ -303,8 +303,8 @@ cdce_ncm_init(struct cdce_softc *sc)
        int err;
 
        ufd = usbd_find_descriptor(sc->sc_ue.ue_udev, NULL,
-           sc->sc_ifaces_index[1], UDESC_CS_INTERFACE, 0 - 1,
-           UCDC_NCM_FUNC_DESC_SUBTYPE, 0 - 1);
+           sc->sc_ifaces_index[1], UDESC_CS_INTERFACE, 0xFF,
+           UCDC_NCM_FUNC_DESC_SUBTYPE, 0xFF);
 
        /* verify length of NCM functional descriptor */
        if (ufd != NULL) {
@@ -514,7 +514,7 @@ cdce_attach(device_t dev)
 
        ud = usbd_find_descriptor
            (uaa->device, NULL, uaa->info.bIfaceIndex,
-           UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_UNION, 0 - 1);
+           UDESC_CS_INTERFACE, 0xFF, UDESCSUB_CDC_UNION, 0xFF);
 
        if ((ud == NULL) || (ud->bLength < sizeof(*ud)) ||
            (sc->sc_flags & CDCE_FLAG_NO_UNION)) {
@@ -598,7 +598,7 @@ alloc_transfers:
 
        ued = usbd_find_descriptor
            (uaa->device, NULL, uaa->info.bIfaceIndex,
-           UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_ENF, 0 - 1);
+           UDESC_CS_INTERFACE, 0xFF, UDESCSUB_CDC_ENF, 0xFF);
 
        if ((ued == NULL) || (ued->bLength < sizeof(*ued))) {
                error = USB_ERR_INVAL;
@@ -892,7 +892,9 @@ cdce_bulk_read_callback(struct usb_xfer 
        struct cdce_softc *sc = usbd_xfer_softc(xfer);
        struct mbuf *m;
        uint8_t x;
-       int actlen, aframes, len;
+       int actlen;
+       int aframes;
+       int len;
 
        usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL);
 
@@ -911,7 +913,7 @@ cdce_bulk_read_callback(struct usb_xfer 
                        if ((sc->sc_flags & CDCE_FLAG_ZAURUS) && len >= 14)
                                len -= 4;
 
-                       if (len < sizeof(struct ether_header)) {
+                       if (len < (int)sizeof(struct ether_header)) {
                                m_freem(m);
                                continue;
                        }
@@ -1096,7 +1098,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer 
                        break;
                }
 
-               if (m->m_pkthdr.len > rem) {
+               if (m->m_pkthdr.len > (int)rem) {
                        if (n == 0) {
                                /* The frame won't fit in our buffer */
                                DPRINTFN(1, "Frame too big to be 
transmitted!\n");
@@ -1278,7 +1280,7 @@ cdce_ncm_bulk_read_callback(struct usb_x
                DPRINTFN(1, "received %u bytes in %u frames\n",
                    actlen, aframes);
 
-               if (actlen < (sizeof(sc->sc_ncm.hdr) +
+               if (actlen < (int)(sizeof(sc->sc_ncm.hdr) +
                    sizeof(sc->sc_ncm.dpt))) {
                        DPRINTFN(1, "frame too short\n");
                        goto tr_setup;
@@ -1305,7 +1307,7 @@ cdce_ncm_bulk_read_callback(struct usb_x
                        goto tr_stall;
                }
                temp = UGETW(sc->sc_ncm.hdr.wDptIndex);
-               if ((temp + sizeof(sc->sc_ncm.dpt)) > actlen) {
+               if ((int)(temp + sizeof(sc->sc_ncm.dpt)) > actlen) {
                        DPRINTFN(1, "invalid DPT index: 0x%04x\n", temp);
                        goto tr_stall;
                }
@@ -1354,7 +1356,7 @@ cdce_ncm_bulk_read_callback(struct usb_x
                        temp = UGETW(sc->sc_ncm.dp[x].wFrameLength);
 
                        if ((offset == 0) ||
-                           (temp < sizeof(struct ether_header)) ||
+                           (temp < (int)sizeof(struct ether_header)) ||
                            (temp > (MCLBYTES - ETHER_ALIGN))) {
                                DPRINTFN(1, "NULL frame detected at %d\n", x);
                                m = NULL;
@@ -1366,7 +1368,7 @@ cdce_ncm_bulk_read_callback(struct usb_x
                                m = NULL;
                                /* silently ignore this frame */
                                continue;
-                       } else if (temp > (MHLEN - ETHER_ALIGN)) {
+                       } else if (temp > (int)(MHLEN - ETHER_ALIGN)) {
                                m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
                        } else {
                                m = m_gethdr(M_DONTWAIT, MT_DATA);

Modified: stable/9/sys/dev/usb/net/if_cue.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_cue.c   Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/if_cue.c   Fri May  4 15:05:30 2012        
(r235000)
@@ -457,7 +457,7 @@ cue_bulk_read_callback(struct usb_xfer *
        switch (USB_GET_STATE(xfer)) {
        case USB_ST_TRANSFERRED:
 
-               if (actlen <= (2 + sizeof(struct ether_header))) {
+               if (actlen <= (int)(2 + sizeof(struct ether_header))) {
                        ifp->if_ierrors++;
                        goto tr_setup;
                }

Modified: stable/9/sys/dev/usb/net/if_ipheth.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_ipheth.c        Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/if_ipheth.c        Fri May  4 15:05:30 2012        
(r235000)
@@ -471,7 +471,7 @@ ipheth_bulk_read_callback(struct usb_xfe
                        sc->sc_rx_buf[x] = NULL;
                        len = usbd_xfer_frame_len(xfer, x);
 
-                       if (len < (sizeof(struct ether_header) +
+                       if (len < (int)(sizeof(struct ether_header) +
                            IPHETH_RX_ADJ)) {
                                m_freem(m);
                                continue;

Modified: stable/9/sys/dev/usb/net/if_kue.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_kue.c   Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/if_kue.c   Fri May  4 15:05:30 2012        
(r235000)
@@ -545,7 +545,7 @@ kue_bulk_read_callback(struct usb_xfer *
        switch (USB_GET_STATE(xfer)) {
        case USB_ST_TRANSFERRED:
 
-               if (actlen <= (2 + sizeof(struct ether_header))) {
+               if (actlen <= (int)(2 + sizeof(struct ether_header))) {
                        ifp->if_ierrors++;
                        goto tr_setup;
                }

Modified: stable/9/sys/dev/usb/net/if_rue.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_rue.c   Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/if_rue.c   Fri May  4 15:05:30 2012        
(r235000)
@@ -638,7 +638,7 @@ rue_intr_callback(struct usb_xfer *xfer,
        case USB_ST_TRANSFERRED:
 
                if (ifp && (ifp->if_drv_flags & IFF_DRV_RUNNING) &&
-                   actlen >= sizeof(pkt)) {
+                   actlen >= (int)sizeof(pkt)) {
 
                        pc = usbd_xfer_get_frame(xfer, 0);
                        usbd_copy_out(pc, 0, &pkt, sizeof(pkt));

Modified: stable/9/sys/dev/usb/net/if_udav.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_udav.c  Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/if_udav.c  Fri May  4 15:05:30 2012        
(r235000)
@@ -642,7 +642,7 @@ udav_bulk_read_callback(struct usb_xfer 
        switch (USB_GET_STATE(xfer)) {
        case USB_ST_TRANSFERRED:
 
-               if (actlen < sizeof(stat) + ETHER_CRC_LEN) {
+               if (actlen < (int)(sizeof(stat) + ETHER_CRC_LEN)) {
                        ifp->if_ierrors++;
                        goto tr_setup;
                }

Modified: stable/9/sys/dev/usb/net/if_usie.c
==============================================================================
--- stable/9/sys/dev/usb/net/if_usie.c  Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/if_usie.c  Fri May  4 15:05:30 2012        
(r235000)
@@ -918,7 +918,7 @@ tr_setup:
                if (m == NULL)
                        break;
 
-               if (m->m_pkthdr.len > (MCLBYTES - ETHER_HDR_LEN +
+               if (m->m_pkthdr.len > (int)(MCLBYTES - ETHER_HDR_LEN +
                    ETHER_CRC_LEN - sizeof(sc->sc_txd))) {
                        DPRINTF("packet len is too big: %d\n",
                            m->m_pkthdr.len);

Modified: stable/9/sys/dev/usb/net/ruephy.c
==============================================================================
--- stable/9/sys/dev/usb/net/ruephy.c   Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/ruephy.c   Fri May  4 15:05:30 2012        
(r235000)
@@ -67,9 +67,9 @@ static device_method_t ruephy_methods[] 
 static devclass_t ruephy_devclass;
 
 static driver_t ruephy_driver = {
-       "ruephy",
-       ruephy_methods,
-       sizeof(struct mii_softc)
+       .name = "ruephy",
+       .methods = ruephy_methods,
+       .size = sizeof(struct mii_softc)
 };
 
 DRIVER_MODULE(ruephy, miibus, ruephy_driver, ruephy_devclass, 0, 0);

Modified: stable/9/sys/dev/usb/net/uhso.c
==============================================================================
--- stable/9/sys/dev/usb/net/uhso.c     Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/net/uhso.c     Fri May  4 15:05:30 2012        
(r235000)
@@ -482,9 +482,9 @@ static device_method_t uhso_methods[] = 
 };
 
 static driver_t uhso_driver = {
-       "uhso",
-       uhso_methods,
-       sizeof(struct uhso_softc)
+       .name = "uhso",
+       .methods = uhso_methods,
+       .size = sizeof(struct uhso_softc)
 };
 
 static devclass_t uhso_devclass;
@@ -1366,7 +1366,7 @@ uhso_bs_intr_callback(struct usb_xfer *x
                        UHSO_DPRINTF(0, "UCDC notification too short: %d\n", 
actlen);
                        goto tr_setup;
                }
-               else if (actlen > sizeof(struct usb_cdc_notification)) {
+               else if (actlen > (int)sizeof(struct usb_cdc_notification)) {
                        UHSO_DPRINTF(0, "UCDC notification too large: %d\n", 
actlen);
                        actlen = sizeof(struct usb_cdc_notification);
                }

Modified: stable/9/sys/dev/usb/serial/ubsa.c
==============================================================================
--- stable/9/sys/dev/usb/serial/ubsa.c  Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/serial/ubsa.c  Fri May  4 15:05:30 2012        
(r235000)
@@ -627,7 +627,7 @@ ubsa_intr_callback(struct usb_xfer *xfer
        switch (USB_GET_STATE(xfer)) {
        case USB_ST_TRANSFERRED:
 
-               if (actlen >= sizeof(buf)) {
+               if (actlen >= (int)sizeof(buf)) {
                        pc = usbd_xfer_get_frame(xfer, 0);
                        usbd_copy_out(pc, 0, buf, sizeof(buf));
 

Modified: stable/9/sys/dev/usb/serial/uchcom.c
==============================================================================
--- stable/9/sys/dev/usb/serial/uchcom.c        Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/serial/uchcom.c        Fri May  4 15:05:30 2012        
(r235000)
@@ -846,9 +846,9 @@ static device_method_t uchcom_methods[] 
 };
 
 static driver_t uchcom_driver = {
-       "ucom",
-       uchcom_methods,
-       sizeof(struct uchcom_softc)
+       .name = "ucom",
+       .methods = uchcom_methods,
+       .size = sizeof(struct uchcom_softc)
 };
 
 static devclass_t uchcom_devclass;

Modified: stable/9/sys/dev/usb/serial/ucycom.c
==============================================================================
--- stable/9/sys/dev/usb/serial/ucycom.c        Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/serial/ucycom.c        Fri May  4 15:05:30 2012        
(r235000)
@@ -519,7 +519,7 @@ ucycom_intr_read_callback(struct usb_xfe
        struct usb_page_cache *pc;
        uint8_t buf[2];
        uint32_t offset;
-       uint32_t len;
+       int len;
        int actlen;
 
        usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);

Modified: stable/9/sys/dev/usb/serial/ufoma.c
==============================================================================
--- stable/9/sys/dev/usb/serial/ufoma.c Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/serial/ufoma.c Fri May  4 15:05:30 2012        
(r235000)
@@ -684,7 +684,7 @@ ufoma_intr_callback(struct usb_xfer *xfe
                        DPRINTF("too short message\n");
                        goto tr_setup;
                }
-               if (actlen > sizeof(pkt)) {
+               if (actlen > (int)sizeof(pkt)) {
                        DPRINTF("truncating message\n");
                        actlen = sizeof(pkt);
                }

Modified: stable/9/sys/dev/usb/serial/ulpt.c
==============================================================================
--- stable/9/sys/dev/usb/serial/ulpt.c  Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/serial/ulpt.c  Fri May  4 15:05:30 2012        
(r235000)
@@ -543,7 +543,7 @@ ulpt_attach(device_t dev)
        /* search through all the descriptors looking for bidir mode */
 
        id = usbd_get_interface_descriptor(uaa->iface);
-       alt_index = 0 - 1;
+       alt_index = 0xFF;
        while (1) {
                if (id == NULL) {
                        break;
@@ -631,14 +631,14 @@ found:
 
        error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
            &ulpt_fifo_methods, &sc->sc_fifo,
-           unit, 0 - 1, uaa->info.bIfaceIndex,
+           unit, -1, uaa->info.bIfaceIndex,
            UID_ROOT, GID_OPERATOR, 0644);
        if (error) {
                goto detach;
        }
        error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
            &unlpt_fifo_methods, &sc->sc_fifo_noreset,
-           unit, 0 - 1, uaa->info.bIfaceIndex,
+           unit, -1, uaa->info.bIfaceIndex,
            UID_ROOT, GID_OPERATOR, 0644);
        if (error) {
                goto detach;

Modified: stable/9/sys/dev/usb/serial/umodem.c
==============================================================================
--- stable/9/sys/dev/usb/serial/umodem.c        Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/serial/umodem.c        Fri May  4 15:05:30 2012        
(r235000)
@@ -317,7 +317,7 @@ umodem_attach(device_t dev)
 
                cud = usbd_find_descriptor(uaa->device, NULL,
                    uaa->info.bIfaceIndex, UDESC_CS_INTERFACE,
-                   0 - 1, UDESCSUB_CDC_UNION, 0 - 1);
+                   0xFF, UDESCSUB_CDC_UNION, 0xFF);
 
                if ((cud == NULL) || (cud->bLength < sizeof(*cud))) {
                        DPRINTF("Missing descriptor. "
@@ -702,7 +702,7 @@ umodem_intr_callback(struct usb_xfer *xf
                            "%d bytes\n", actlen);
                        goto tr_setup;
                }
-               if (actlen > sizeof(pkt)) {
+               if (actlen > (int)sizeof(pkt)) {
                        DPRINTF("truncating message\n");
                        actlen = sizeof(pkt);
                }
@@ -842,7 +842,7 @@ static void *
 umodem_get_desc(struct usb_attach_arg *uaa, uint8_t type, uint8_t subtype)
 {
        return (usbd_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex,
-           type, 0 - 1, subtype, 0 - 1));
+           type, 0xFF, subtype, 0xFF));
 }
 
 static usb_error_t

Modified: stable/9/sys/dev/usb/serial/uplcom.c
==============================================================================
--- stable/9/sys/dev/usb/serial/uplcom.c        Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/serial/uplcom.c        Fri May  4 15:05:30 2012        
(r235000)
@@ -606,7 +606,7 @@ uplcom_cfg_set_break(struct ucom_softc *
            &req, NULL, 0, 1000);
 }
 
-static const int32_t uplcom_rates[] = {
+static const uint32_t uplcom_rates[] = {
        75, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 14400,
        19200, 28800, 38400, 57600, 115200,
        /*

Modified: stable/9/sys/dev/usb/serial/usb_serial.c
==============================================================================
--- stable/9/sys/dev/usb/serial/usb_serial.c    Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/serial/usb_serial.c    Fri May  4 15:05:30 2012        
(r235000)
@@ -236,14 +236,14 @@ ucom_unit_free(int unit)
  */
 int
 ucom_attach(struct ucom_super_softc *ssc, struct ucom_softc *sc,
-    uint32_t subunits, void *parent,
+    int subunits, void *parent,
     const struct ucom_callback *callback, struct mtx *mtx)
 {
-       uint32_t subunit;
+       int subunit;
        int error = 0;
 
        if ((sc == NULL) ||
-           (subunits == 0) ||
+           (subunits <= 0) ||
            (callback == NULL)) {
                return (EINVAL);
        }
@@ -293,7 +293,7 @@ ucom_attach(struct ucom_super_softc *ssc
 void
 ucom_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc)
 {
-       uint32_t subunit;
+       int subunit;
 
        if (ssc->sc_subunits == 0)
                return;         /* not initialized */
@@ -1089,11 +1089,6 @@ ucom_param(struct tty *tp, struct termio
        DPRINTF("sc = %p\n", sc);
 
        /* Check requested parameters. */
-       if (t->c_ospeed < 0) {
-               DPRINTF("negative ospeed\n");
-               error = EINVAL;
-               goto done;
-       }
        if (t->c_ispeed && (t->c_ispeed != t->c_ospeed)) {
                DPRINTF("mismatch ispeed and ospeed\n");
                error = EINVAL;

Modified: stable/9/sys/dev/usb/serial/usb_serial.h
==============================================================================
--- stable/9/sys/dev/usb/serial/usb_serial.h    Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/serial/usb_serial.h    Fri May  4 15:05:30 2012        
(r235000)
@@ -166,7 +166,7 @@ struct ucom_softc {
        struct tty *sc_tty;
        struct mtx *sc_mtx;
        void   *sc_parent;
-       uint32_t sc_subunit;
+       int sc_subunit;
        uint16_t sc_portno;
        uint16_t sc_flag;
 #define        UCOM_FLAG_RTS_IFLOW     0x01    /* use RTS input flow control */
@@ -194,7 +194,7 @@ struct ucom_softc {
     usbd_do_request_proc(udev,&(com)->sc_super->sc_tq,req,ptr,flags,NULL,timo)
 
 int    ucom_attach(struct ucom_super_softc *,
-           struct ucom_softc *, uint32_t, void *,
+           struct ucom_softc *, int, void *,
            const struct ucom_callback *callback, struct mtx *);
 void   ucom_detach(struct ucom_super_softc *, struct ucom_softc *);
 void   ucom_set_pnpinfo_usb(struct ucom_super_softc *, device_t);

Modified: stable/9/sys/dev/usb/storage/umass.c
==============================================================================
--- stable/9/sys/dev/usb/storage/umass.c        Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/storage/umass.c        Fri May  4 15:05:30 2012        
(r235000)
@@ -1482,7 +1482,7 @@ umass_t_bbb_status_callback(struct usb_x
 
                /* Zero missing parts of the CSW: */
 
-               if (actlen < sizeof(sc->csw))
+               if (actlen < (int)sizeof(sc->csw))
                        memset(&sc->csw, 0, sizeof(sc->csw));
 
                pc = usbd_xfer_get_frame(xfer, 0);
@@ -2016,7 +2016,7 @@ umass_t_cbi_status_callback(struct usb_x
        switch (USB_GET_STATE(xfer)) {
        case USB_ST_TRANSFERRED:
 
-               if (actlen < sizeof(sc->sbl)) {
+               if (actlen < (int)sizeof(sc->sbl)) {
                        goto tr_setup;
                }
                pc = usbd_xfer_get_frame(xfer, 0);

Modified: stable/9/sys/dev/usb/storage/urio.c
==============================================================================
--- stable/9/sys/dev/usb/storage/urio.c Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/storage/urio.c Fri May  4 15:05:30 2012        
(r235000)
@@ -246,7 +246,7 @@ urio_attach(device_t dev)
 
        error = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx,
            &urio_fifo_methods, &sc->sc_fifo,
-           device_get_unit(dev), 0 - 1, uaa->info.bIfaceIndex,
+           device_get_unit(dev), -1, uaa->info.bIfaceIndex,
            UID_ROOT, GID_OPERATOR, 0644);
        if (error) {
                goto detach;

Modified: stable/9/sys/dev/usb/storage/ustorage_fs.c
==============================================================================
--- stable/9/sys/dev/usb/storage/ustorage_fs.c  Fri May  4 14:10:54 2012        
(r234999)
+++ stable/9/sys/dev/usb/storage/ustorage_fs.c  Fri May  4 15:05:30 2012        
(r235000)
@@ -967,7 +967,7 @@ ustorage_fs_verify(struct ustorage_fs_so
        }
        /* XXX TODO: verify that data is readable */
 done:
-       return (ustorage_fs_min_len(sc, 0, 0 - 1));
+       return (ustorage_fs_min_len(sc, 0, -1U));
 }
 
 /*------------------------------------------------------------------------*
@@ -989,7 +989,7 @@ ustorage_fs_inquiry(struct ustorage_fs_s
                memset(buf, 0, 36);
                buf[0] = 0x7f;
                /* Unsupported, no device - type */
-               return (ustorage_fs_min_len(sc, 36, 0 - 1));
+               return (ustorage_fs_min_len(sc, 36, -1U));
        }
        memset(buf, 0, 8);
        /* Non - removable, direct - access device */
@@ -1008,7 +1008,7 @@ ustorage_fs_inquiry(struct ustorage_fs_s
 #if (USTORAGE_QDATA_MAX < 36)
 #error "(USTORAGE_QDATA_MAX < 36)"
 #endif
-       return (ustorage_fs_min_len(sc, 36, 0 - 1));
+       return (ustorage_fs_min_len(sc, 36, -1U));
 }
 
 /*------------------------------------------------------------------------*
@@ -1077,7 +1077,7 @@ ustorage_fs_request_sense(struct ustorag
 #if (USTORAGE_QDATA_MAX < 18)
 #error "(USTORAGE_QDATA_MAX < 18)"
 #endif
-       return (ustorage_fs_min_len(sc, 18, 0 - 1));
+       return (ustorage_fs_min_len(sc, 18, -1U));
 }
 
 /*------------------------------------------------------------------------*
@@ -1108,7 +1108,7 @@ ustorage_fs_read_capacity(struct ustorag
 #if (USTORAGE_QDATA_MAX < 8)
 #error "(USTORAGE_QDATA_MAX < 8)"
 #endif
-       return (ustorage_fs_min_len(sc, 8, 0 - 1));
+       return (ustorage_fs_min_len(sc, 8, -1U));
 }
 
 /*------------------------------------------------------------------------*
@@ -1215,7 +1215,7 @@ ustorage_fs_mode_sense(struct ustorage_f
 #if (USTORAGE_QDATA_MAX < 24)
 #error "(USTORAGE_QDATA_MAX < 24)"
 #endif
-       return (ustorage_fs_min_len(sc, len, 0 - 1));
+       return (ustorage_fs_min_len(sc, len, -1U));
 }
 
 /*------------------------------------------------------------------------*
@@ -1305,7 +1305,7 @@ ustorage_fs_read_format_capacities(struc
 #if (USTORAGE_QDATA_MAX < 12)
 #error "(USTORAGE_QDATA_MAX < 12)"
 #endif
-       return (ustorage_fs_min_len(sc, 12, 0 - 1));
+       return (ustorage_fs_min_len(sc, 12, -1U));
 }
 
 /*------------------------------------------------------------------------*
@@ -1618,7 +1618,7 @@ ustorage_fs_do_cmd(struct ustorage_fs_so
        switch (sc->sc_cmd_data[0]) {
        case SC_INQUIRY:
                sc->sc_transfer.cmd_dir = DIR_WRITE;
-               error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], 0 - 1);
+               error = ustorage_fs_min_len(sc, sc->sc_cmd_data[4], -1U);
                if (error) {
                        break;
                }

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to