diff options
author | David Brownell <david-b@pacbell.net> | 2007-07-30 15:31:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-30 16:27:47 -0400 |
commit | a9475226977917afd5a85621f8a3d7f380a9da31 (patch) | |
tree | d153161062da7286eb4e83e325d5a1f75f3a5cb8 /drivers/usb/gadget/inode.c | |
parent | bc71e479cdb2caab9b4473f7ad508c3fcb142486 (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/gadget/inode.c')
-rw-r--r-- | drivers/usb/gadget/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |