[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160823080417.GD16896@localhost>
Date: Tue, 23 Aug 2016 10:04:17 +0200
From: Johan Hovold <johan@...nel.org>
To: Mathieu OTHACEHE <m.othacehe@...il.com>
Cc: johan@...nel.org, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH v2 04/22] usb: serial: ti_usb_3410_5052: Remove useless
NULL-testing
On Tue, Jul 26, 2016 at 07:59:44PM +0200, Mathieu OTHACEHE wrote:
> It is useless to check the return of usb_get_serial_port_data.
Please be more specific in your commit messages in general. In this case
it should mention that there's no need to check for NULL private data in
the tty or tty-port callbacks.
> Signed-off-by: Mathieu OTHACEHE <m.othacehe@...il.com>
> ---
> drivers/usb/serial/ti_usb_3410_5052.c | 34 +---------------------------------
> 1 file changed, 1 insertion(+), 33 deletions(-)
>
> diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
> index b694d69..c8ed3f9 100644
> --- a/drivers/usb/serial/ti_usb_3410_5052.c
> +++ b/drivers/usb/serial/ti_usb_3410_5052.c
> @@ -653,9 +653,6 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port)
> TI_PIPE_TIMEOUT_ENABLE |
> (TI_TRANSFER_TIMEOUT << 2));
>
> - if (tport == NULL)
> - return -ENODEV;
> -
> dev = port->serial->dev;
> tdev = tport->tp_tdev;
>
> @@ -784,8 +781,6 @@ static void ti_close(struct usb_serial_port *port)
>
> tdev = usb_get_serial_data(port->serial);
> tport = usb_get_serial_port_data(port);
> - if (tdev == NULL || tport == NULL)
> - return;
You also forgot to mention that you are removing a check for interface
private data in close().
I fixes this up before applying this time.
Thanks,
Johan
Powered by blists - more mailing lists