From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932743AbcGOL15 (ORCPT ); Fri, 15 Jul 2016 07:27:57 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34406 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932590AbcGOL1y (ORCPT ); Fri, 15 Jul 2016 07:27:54 -0400 Date: Fri, 15 Jul 2016 13:27:56 +0200 From: Johan Hovold To: Mathieu OTHACEHE Cc: johan@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 16/36] usb: serial: ti_usb_3410_5052: Use bulk_out_size in TIOCGSERIAL Message-ID: <20160715112756.GI8809@localhost> References: <1463042948-12205-1-git-send-email-m.othacehe@gmail.com> <1463042948-12205-17-git-send-email-m.othacehe@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463042948-12205-17-git-send-email-m.othacehe@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2016 at 10:48:48AM +0200, Mathieu OTHACEHE wrote: > Use bulk_out_size instead of recalculate it with kfifo_size > > Signed-off-by: Mathieu OTHACEHE > --- > drivers/usb/serial/ti_usb_3410_5052.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c > index eb4df1e..5ef721c 100644 > --- a/drivers/usb/serial/ti_usb_3410_5052.c > +++ b/drivers/usb/serial/ti_usb_3410_5052.c > @@ -1205,7 +1205,7 @@ static int ti_get_serial_info(struct ti_port *tport, > ret_serial.type = PORT_16550A; > ret_serial.line = port->minor; > ret_serial.port = port->port_number; > - ret_serial.xmit_fifo_size = kfifo_size(&port->write_fifo); > + ret_serial.xmit_fifo_size = port->bulk_out_size; These two are in not equivalent. bulk_out_size holds the urb buffer size (which coincides with the endpoint size by default, but need to do so), while the fifo size is the size of the write fifo, which is typically always larger. This field is supposed to reflect the hardware fifo size, and we don't really use it consistently for usb-serial drivers. I'd just leave it as is for now. Thanks, Johan