Re: [patch] dbgp: cleanup: remove unneeded check

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

 



Acked-by: Stephane duverger <stephane.duverger@xxxxxxxxx>

> len is always greater than or equal to zero here.  First of all, it's
> type is unsigned and also we only assign it numbers which are greater
> than or equal to zero.
> 
> Removing the check lets us pull everything in an indent level.
> 
> Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
> 
> diff --git a/drivers/usb/gadget/dbgp.c b/drivers/usb/gadget/dbgp.c
> index 0ed50a2..abe4a2e 100644
> --- a/drivers/usb/gadget/dbgp.c
> +++ b/drivers/usb/gadget/dbgp.c
> @@ -386,15 +386,13 @@ static int dbgp_setup(struct usb_gadget *gadget,
>  	} else
>  		goto fail;
>  
> -	if (len >= 0) {
> -		req->length = min(length, len);
> -		req->zero = len < req->length;
> -		if (data && req->length)
> -			memcpy(req->buf, data, req->length);
> -
> -		req->complete = dbgp_setup_complete;
> -		return usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);
> -	}
> +	req->length = min(length, len);
> +	req->zero = len < req->length;
> +	if (data && req->length)
> +		memcpy(req->buf, data, req->length);
> +
> +	req->complete = dbgp_setup_complete;
> +	return usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);
>  
>  fail:
>  	dev_dbg(&dbgp.gadget->dev,
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux