]> git.hungrycats.org Git - linux/commitdiff
[PATCH] USB: drivers/usb/gadget/epautoconf.c gcc-3.5 build fix
authorAndrew Morton <akpm@osdl.org>
Tue, 30 Mar 2004 06:10:11 +0000 (22:10 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 30 Mar 2004 06:10:11 +0000 (22:10 -0800)
drivers/usb/gadget/epautoconf.c: In function `ep_matches':
drivers/usb/gadget/epautoconf.c:175: error: `typeof' applied to a bit-field

drivers/usb/gadget/epautoconf.c

index 29c10be324e17c700054113a2620b5da8075dce9..b15c44a5c63a379b9d822d66f0161264ed89da74 100644 (file)
@@ -171,9 +171,14 @@ ep_matches (
        }
 
        /* report (variable) full speed bulk maxpacket */
-       if (USB_ENDPOINT_XFER_BULK == type)
-               desc->wMaxPacketSize = cpu_to_le16 (
-                               min ((unsigned)64, ep->maxpacket));
+       if (USB_ENDPOINT_XFER_BULK == type) {
+               int size = ep->maxpacket;
+
+               /* min() doesn't work on bitfields with gcc-3.5 */
+               if (size > 64)
+                       size = 64;
+               desc->wMaxPacketSize = cpu_to_le16(size);
+       }
        return 1;
 }