usb: gadget: add a sparse endian notation
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 17 Apr 2012 06:30:22 +0000 (09:30 +0300)
committerFelipe Balbi <balbi@ti.com>
Fri, 4 May 2012 12:53:08 +0000 (15:53 +0300)
The original code works fine, but Sparse complains because it isn't
annotated properly.

drivers/usb/gadget/composite.c:793:26: warning: incorrect type in assignment (different base types)
drivers/usb/gadget/composite.c:793:26:    expected unsigned short [unsigned] [usertype] language
devel/drivers/usb/gadget/composite.c:793:26:    got restricted __le16 [usertype] <noident>
devel/drivers/usb/gadget/composite.c:795:29: warning: restricted __le16 degrades to integer
drivers/usb/gadget/composite.c:798:24: warning: incorrect type in assignment (different base types)
drivers/usb/gadget/composite.c:798:24:    expected restricted __le16 [usertype] <noident>
devel/drivers/usb/gadget/composite.c:798:24:    got unsigned short [unsigned] [usertype] language

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/composite.c

index 4cb1801539a6626ceb22ca52dfedcc872625efae..a3b19fe37f53ff2cd400046729e2ecad5402f541 100644 (file)
@@ -798,7 +798,7 @@ done:
 static void collect_langs(struct usb_gadget_strings **sp, __le16 *buf)
 {
        const struct usb_gadget_strings *s;
-       u16                             language;
+       __le16                          language;
        __le16                          *tmp;
 
        while (*sp) {