]> git.hungrycats.org Git - linux/commitdiff
Minor endianness and debugging fixes. Most thanks to Dave Miller.
authorVojtech Pavlik <vojtech@suse.cz>
Tue, 27 Aug 2002 11:59:42 +0000 (13:59 +0200)
committerVojtech Pavlik <vojtech@suse.cz>
Tue, 27 Aug 2002 11:59:42 +0000 (13:59 +0200)
drivers/usb/input/hid-core.c

index 3ab85bfdbdcb5f8926d4234c0a1e3b7019a17685..3d8e05775c68f4b4cf2a4eb9ea44404c925a3da6 100644 (file)
@@ -879,7 +879,7 @@ static int hid_input_report(int type, struct urb *urb)
        {
                int i;
                printk(KERN_DEBUG __FILE__ ": report %d (size %u) = ", n, len);
-               for (i = 0; i < n; i++)
+               for (i = 0; i < len; i++)
                        printk(" %02x", data[i]);
                printk("\n");
        }
@@ -1384,7 +1384,7 @@ static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum)
 #ifdef DEBUG_DATA
        printk(KERN_DEBUG __FILE__ ": report descriptor (size %u, read %d) = ", rsize, n);
        for (n = 0; n < rsize; n++)
-               printk(" %02x", (unsigned) rdesc[n]);
+               printk(" %02x", (unsigned char) rdesc[n]);
        printk("\n");
 #endif
 
@@ -1432,7 +1432,7 @@ static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum)
        hid->outlock = SPIN_LOCK_UNLOCKED;
        hid->ctrllock = SPIN_LOCK_UNLOCKED;
 
-       hid->version = hdesc->bcdHID;
+       hid->version = le16_to_cpu(hdesc->bcdHID);
        hid->country = hdesc->bCountryCode;
        hid->dev = dev;
        hid->ifnum = interface->bInterfaceNumber;