Re: [PATCH] USB: DWC3: Remove WARN_ON from dwc_stop_active_transfer

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

 



Hi,

On Fri, Jun 22, 2012 at 05:04:24PM +0530, Pratyush Anand wrote:
> Now we are sure that, if res_trans_idx is zero, then endpoint has been
> stopped.So, Its safe to just return, if endpoint is already stopped. No
> need to generate warning now.
> 
> Signed-off-by: Pratyush Anand <pratyush.anand@xxxxxx>
> ---
>  drivers/usb/dwc3/gadget.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 3f555f0..1b29b6a 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1905,7 +1905,6 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
>  
>  	dep = dwc->eps[epnum];
>  
> -	WARN_ON(!dep->res_trans_idx);
>  	if (dep->res_trans_idx) {

just one small comment:

while doing that, can you decrease the indentation too by returning
early if res_trans_idx is zero. What is to add:

if (!dep->res_trans_idx)
	return;

so that all that code can come out of the {} and decrease one tab of
indentation. Then I'll rebase my "rename res_trans_idx to
resource_index" patch on top of this one and apply to my dwc3 branch.

ps: when doing this change, please make sure to add to commit log
something like:

while at that also decrease indentation by returning early when
res_trans_idx is zero

or something similar.

-- 
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