aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-07-30 15:31:07 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-30 16:27:47 -0400
commita9475226977917afd5a85621f8a3d7f380a9da31 (patch)
treed153161062da7286eb4e83e325d5a1f75f3a5cb8 /drivers/usb
parentbc71e479cdb2caab9b4473f7ad508c3fcb142486 (diff)
USB: "sparse" cleanups for usb gadgets
This removes complaints about the gadget stack which are generated by the currrent "sparse": it doesn't like the fact that zero is the null pointer. (Last I checked, C guarantees that's correct ...) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/config.c2
-rw-r--r--drivers/usb/gadget/epautoconf.c2
-rw-r--r--drivers/usb/gadget/ether.c3
-rw-r--r--drivers/usb/gadget/inode.c4
-rw-r--r--drivers/usb/gadget/m66592-udc.c2
-rw-r--r--drivers/usb/gadget/zero.c6
6 files changed, 11 insertions, 8 deletions
diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c
index d18901b92cda..c6760aee1e5c 100644
--- a/drivers/usb/gadget/config.c
+++ b/drivers/usb/gadget/config.c
@@ -50,7 +50,7 @@ usb_descriptor_fillbuf(void *buf, unsigned buflen,
50 return -EINVAL; 50 return -EINVAL;
51 51
52 /* fill buffer from src[] until null descriptor ptr */ 52 /* fill buffer from src[] until null descriptor ptr */
53 for (; 0 != *src; src++) { 53 for (; NULL != *src; src++) {
54 unsigned len = (*src)->bLength; 54 unsigned len = (*src)->bLength;
55 55
56 if (len > buflen) 56 if (len > buflen)
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 6042364402b8..3aa46cfa66ba 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -71,7 +71,7 @@ ep_matches (
71 u16 max; 71 u16 max;
72 72
73 /* endpoint already claimed? */ 73 /* endpoint already claimed? */
74 if (0 != ep->driver_data) 74 if (NULL != ep->driver_data)
75 return 0; 75 return 0;
76 76
77 /* only support ep0 for portable CONTROL traffic */ 77 /* only support ep0 for portable CONTROL traffic */
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index a3376739a81b..593e23507b1a 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1723,7 +1723,8 @@ rx_submit (struct eth_dev *dev, struct usb_request *req, gfp_t gfp_flags)
1723 size += sizeof (struct rndis_packet_msg_type); 1723 size += sizeof (struct rndis_packet_msg_type);
1724 size -= size % dev->out_ep->maxpacket; 1724 size -= size % dev->out_ep->maxpacket;
1725 1725
1726 if ((skb = alloc_skb (size + NET_IP_ALIGN, gfp_flags)) == 0) { 1726 skb = alloc_skb(size + NET_IP_ALIGN, gfp_flags);
1727 if (skb == NULL) {
1727 DEBUG (dev, "no rx skb\n"); 1728 DEBUG (dev, "no rx skb\n");
1728 goto enomem; 1729 goto enomem;
1729 } 1730 }
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index e60745ffaf8e..173004f60fea 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -964,7 +964,7 @@ static int setup_req (struct usb_ep *ep, struct usb_request *req, u16 len)
964 } 964 }
965 if (len > sizeof (dev->rbuf)) 965 if (len > sizeof (dev->rbuf))
966 req->buf = kmalloc(len, GFP_ATOMIC); 966 req->buf = kmalloc(len, GFP_ATOMIC);
967 if (req->buf == 0) { 967 if (req->buf == NULL) {
968 req->buf = dev->rbuf; 968 req->buf = dev->rbuf;
969 return -ENOMEM; 969 return -ENOMEM;
970 } 970 }
@@ -1394,7 +1394,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1394 dev->setup_abort = 0; 1394 dev->setup_abort = 0;
1395 if (dev->state == STATE_DEV_UNCONNECTED) { 1395 if (dev->state == STATE_DEV_UNCONNECTED) {
1396#ifdef CONFIG_USB_GADGET_DUALSPEED 1396#ifdef CONFIG_USB_GADGET_DUALSPEED
1397 if (gadget->speed == USB_SPEED_HIGH && dev->hs_config == 0) { 1397 if (gadget->speed == USB_SPEED_HIGH && dev->hs_config == NULL) {
1398 spin_unlock(&dev->lock); 1398 spin_unlock(&dev->lock);
1399 ERROR (dev, "no high speed config??\n"); 1399 ERROR (dev, "no high speed config??\n");
1400 return -EINVAL; 1400 return -EINVAL;
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 700dda8a9157..4b27d12f049d 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1299,7 +1299,7 @@ static int m66592_queue(struct usb_ep *_ep, struct usb_request *_req,
1299 req->req.actual = 0; 1299 req->req.actual = 0;
1300 req->req.status = -EINPROGRESS; 1300 req->req.status = -EINPROGRESS;
1301 1301
1302 if (ep->desc == 0) /* control */ 1302 if (ep->desc == NULL) /* control */
1303 start_ep0(ep, req); 1303 start_ep0(ep, req);
1304 else { 1304 else {
1305 if (request && !ep->busy) 1305 if (request && !ep->busy)
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index a2e6e3fc8c8d..fcfe869acb94 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -653,7 +653,8 @@ set_source_sink_config (struct zero_dev *dev, gfp_t gfp_flags)
653 result = usb_ep_enable (ep, d); 653 result = usb_ep_enable (ep, d);
654 if (result == 0) { 654 if (result == 0) {
655 ep->driver_data = dev; 655 ep->driver_data = dev;
656 if (source_sink_start_ep (ep, gfp_flags) != 0) { 656 if (source_sink_start_ep(ep, gfp_flags)
657 != NULL) {
657 dev->in_ep = ep; 658 dev->in_ep = ep;
658 continue; 659 continue;
659 } 660 }
@@ -667,7 +668,8 @@ set_source_sink_config (struct zero_dev *dev, gfp_t gfp_flags)
667 result = usb_ep_enable (ep, d); 668 result = usb_ep_enable (ep, d);
668 if (result == 0) { 669 if (result == 0) {
669 ep->driver_data = dev; 670 ep->driver_data = dev;
670 if (source_sink_start_ep (ep, gfp_flags) != 0) { 671 if (source_sink_start_ep(ep, gfp_flags)
672 != NULL) {
671 dev->out_ep = ep; 673 dev->out_ep = ep;
672 continue; 674 continue;
673 } 675 }