Re: [PATCH] usb: gadget: net2272: fix sparse warnings

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

 



On Thu, 21 Mar 2013, Felipe Balbi wrote:

> Fix the following sparse warnings:
> 
> drivers/usb/gadget/net2272.c:916:13: warning: Using plain integer as NULL pointer
> drivers/usb/gadget/net2272.c:1624:9: warning: Using plain integer as NULL pointer
> drivers/usb/gadget/net2272.c:1552:30: warning: right shift by bigger than source value
> 
> Note that the last warning is an actual bug,
> since ep->dma is a one bit value which is
> shifted by one bit in code.
> 
> Signed-off-by: Felipe Balbi <balbi@xxxxxx>
> ---
> 
> Hi Alan,
> 
> found this when building drivers/usb/gadget/ with sparse
> checks. I'm only concerned about the second hunk. Do
> you think it's correct ? I don't have HW to test neither
> do I have documentation to read.

I don't have hardware or documentation either.

> @@ -1549,7 +1549,7 @@ net2272_handle_dma(struct net2272_ep *ep)
>  	      | (ep->dev->dma_eot_polarity << EOT_POLARITY)
>  	      | (ep->dev->dma_dack_polarity << DACK_POLARITY)
>  	      | (ep->dev->dma_dreq_polarity << DREQ_POLARITY)
> -	      | ((ep->dma >> 1) << DMA_ENDPOINT_SELECT));
> +	      | (ep->dma << DMA_ENDPOINT_SELECT));

I don't know what was intended here.  The most likely possibility is
that the right shift was just a mistake, in which case your fix is the
right one.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux