Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9475226 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman
Browse files

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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bc71e479
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ usb_descriptor_fillbuf(void *buf, unsigned buflen,
		return -EINVAL;

	/* fill buffer from src[] until null descriptor ptr */
	for (; 0 != *src; src++) {
	for (; NULL != *src; src++) {
		unsigned		len = (*src)->bLength;

		if (len > buflen)
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ ep_matches (
	u16		max;

	/* endpoint already claimed? */
	if (0 != ep->driver_data)
	if (NULL != ep->driver_data)
		return 0;

	/* only support ep0 for portable CONTROL traffic */
+2 −1
Original line number Diff line number Diff line
@@ -1723,7 +1723,8 @@ rx_submit (struct eth_dev *dev, struct usb_request *req, gfp_t gfp_flags)
		size += sizeof (struct rndis_packet_msg_type);
	size -= size % dev->out_ep->maxpacket;

	if ((skb = alloc_skb (size + NET_IP_ALIGN, gfp_flags)) == 0) {
	skb = alloc_skb(size + NET_IP_ALIGN, gfp_flags);
	if (skb == NULL) {
		DEBUG (dev, "no rx skb\n");
		goto enomem;
	}
+2 −2
Original line number Diff line number Diff line
@@ -964,7 +964,7 @@ static int setup_req (struct usb_ep *ep, struct usb_request *req, u16 len)
	}
	if (len > sizeof (dev->rbuf))
		req->buf = kmalloc(len, GFP_ATOMIC);
	if (req->buf == 0) {
	if (req->buf == NULL) {
		req->buf = dev->rbuf;
		return -ENOMEM;
	}
@@ -1394,7 +1394,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
	dev->setup_abort = 0;
	if (dev->state == STATE_DEV_UNCONNECTED) {
#ifdef	CONFIG_USB_GADGET_DUALSPEED
		if (gadget->speed == USB_SPEED_HIGH && dev->hs_config == 0) {
		if (gadget->speed == USB_SPEED_HIGH && dev->hs_config == NULL) {
			spin_unlock(&dev->lock);
			ERROR (dev, "no high speed config??\n");
			return -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -1299,7 +1299,7 @@ static int m66592_queue(struct usb_ep *_ep, struct usb_request *_req,
	req->req.actual = 0;
	req->req.status = -EINPROGRESS;

	if (ep->desc == 0)	/* control */
	if (ep->desc == NULL)	/* control */
		start_ep0(ep, req);
	else {
		if (request && !ep->busy)
Loading