From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757448AbcHWIEZ (ORCPT ); Tue, 23 Aug 2016 04:04:25 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:35362 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755548AbcHWIEU (ORCPT ); Tue, 23 Aug 2016 04:04:20 -0400 Date: Tue, 23 Aug 2016 10:04:17 +0200 From: Johan Hovold To: Mathieu OTHACEHE Cc: johan@kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2 04/22] usb: serial: ti_usb_3410_5052: Remove useless NULL-testing Message-ID: <20160823080417.GD16896@localhost> References: <20160726180002.2398-1-m.othacehe@gmail.com> <20160726180002.2398-5-m.othacehe@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160726180002.2398-5-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 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 > --- > 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