Re: usb: gadget: mv: Add USB 3.0 device driver for Marvell PXA2128 chip.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 11, 2015 at 02:16:59PM -0500, Felipe Balbi wrote:
> On Tue, Aug 11, 2015 at 10:13:40PM +0300, Dan Carpenter wrote:
> > Hello Yu Xu,
> > 
> > The patch 3d4eb9dfa3e8: "usb: gadget: mv: Add USB 3.0 device driver
> > for Marvell PXA2128 chip." from Jun 15, 2012, leads to the following
> > static checker warning:
> > 
> > 	drivers/usb/gadget/udc/mv_u3d_core.c:1668 mv_u3d_irq_process_tr_complete()
> > 	warn: 'status' can be either negative or positive
> > 
> > drivers/usb/gadget/udc/mv_u3d_core.c
> >   1664                  /* process the req queue until an uncomplete request */
> >   1665                  list_for_each_entry_safe(curr_req, temp_req,
> >   1666                          &curr_ep->queue, queue) {
> >   1667                          status = mv_u3d_process_ep_req(u3d, i, curr_req);
> >   1668                          if (status)
> > 
> > Probably if (status < 0) was intended
> 
> I'd say a better fix would be to guarantee that mv_u3d_process_ep_req()
> only returns 0 or negative errno.

this is probably enough:

diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c
index ea35a248c898..3eb599ab8f82 100644
--- a/drivers/usb/gadget/udc/mv_u3d_core.c
+++ b/drivers/usb/gadget/udc/mv_u3d_core.c
@@ -139,7 +139,7 @@ static int mv_u3d_process_ep_req(struct mv_u3d *u3d, int index,
 		if (!curr_trb->trb_hw->ctrl.own) {
 			dev_err(u3d->dev, "%s, TRB own error!\n",
 				u3d->eps[index].name);
-			return 1;
+			return -EBUSY;
 		}
 
 		curr_trb->trb_hw->ctrl.own = 0;

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux