Re: [PATCH 4/6] USB: gadget/u_serial.c: Eliminate redundant test.

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

 



On Thursday 27 August 2009, George Spelvin wrote:
> You're allowed to call gs_buf_put with a zero count, and it's not a common
> case that deserves optimizing.

Acked-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

> ---
>  drivers/usb/gadget/u_serial.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
> index 86e9ffc..427f9b6 100644
> --- a/drivers/usb/gadget/u_serial.c
> +++ b/drivers/usb/gadget/u_serial.c
> @@ -881,8 +881,7 @@ static int gs_write(struct tty_struct *tty, const unsigned char *buf, int count)
>  			port->port_num, tty, count);
>  
>  	spin_lock_irqsave(&port->port_lock, flags);
> -	if (count)
> -		count = gs_buf_put(&port->port_write_buf, buf, count);
> +	count = gs_buf_put(&port->port_write_buf, buf, count);
>  	/* treat count == 0 as flush_chars() */
>  	if (port->port_usb)
>  		status = gs_start_tx(port);
> -- 
> 1.6.3.3
> 
> 



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