From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Hurley Subject: Re: [PATCH v2 05/11] tty: serial: 8250: Remove else after return Date: Fri, 18 Dec 2015 07:37:26 -0800 Message-ID: <56742836.2050004@hurleysoftware.com> References: <1450437723-2978-1-git-send-email-anton.wuerfel@fau.de> <1450437723-2978-6-git-send-email-anton.wuerfel@fau.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , "James E.J. Bottomley" , Helge Deller , Heikki Krogerus , Andy Shevchenko , Qipeng Zha , Desmond Liu , Wang Long , Matt Redfearn , Paul Burton , Ralf Baechle , Krzysztof Kozlowski , Peter Hung , Soeren Grunewald , Adam Lee , "Maciej S. Szmigiero" , Mans Rullgard , linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linux-kernel@i4.cs.fau.de, Phillip Raffeck Return-path: In-Reply-To: <1450437723-2978-6-git-send-email-anton.wuerfel@fau.de> List-ID: List-Id: linux-parisc.vger.kernel.org On 12/18/2015 03:21 AM, Anton Wuerfel wrote: > This patch fixes checkpatch warnings about unnecessary else blocks af= ter > return statements. Reviewed-by: Peter Hurley See note below. > Signed-off-by: Anton W=C3=BCrfel > Signed-off-by: Phillip Raffeck > CC: linux-kernel@i4.cs.fau.de > --- > drivers/tty/serial/8250/8250_pci.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/= 8250/8250_pci.c > index 7f9f245..09157fa 100644 > --- a/drivers/tty/serial/8250/8250_pci.c > +++ b/drivers/tty/serial/8250/8250_pci.c > @@ -805,10 +805,10 @@ static int pci_netmos_9900_numports(struct pci_= dev *dev) > =20 > pi =3D (c & 0xff); > =20 > - if (pi =3D=3D 2) { > + if (pi =3D=3D 2) > return 1; > - } else if ((pi =3D=3D 0) && > - (dev->device =3D=3D PCI_DEVICE_ID_NETMOS_9900)) { > + > + if ((pi =3D=3D 0) && (dev->device =3D=3D PCI_DEVICE_ID_NETMOS_9900)= ) { > /* two possibilities: 0x30ps encodes number of parallel and > * serial ports, or 0x1000 indicates *something*. This is not > * immediately obvious, since the 2s1p+4s configuration seems checkpatch missed this comment style because it's what netdev uses. Not a problem, though. We're not quite so formal here. > @@ -816,12 +816,11 @@ static int pci_netmos_9900_numports(struct pci_= dev *dev) > * advertising the same function 3 as the 4s+2s1p config. > */ > sub_serports =3D dev->subsystem_device & 0xf; > - if (sub_serports > 0) { > + if (sub_serports > 0) > return sub_serports; > - } else { > - dev_err(&dev->dev, "NetMos/Mostech serial driver ignoring port on= ambiguous config.\n"); > - return 0; > - } > + > + dev_err(&dev->dev, "NetMos/Mostech serial driver ignoring port on = ambiguous config.\n"); > + return 0; > } > =20 > moan_device("unknown NetMos/Mostech program interface", dev); >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932691AbbLRPhh (ORCPT ); Fri, 18 Dec 2015 10:37:37 -0500 Received: from mail-pf0-f171.google.com ([209.85.192.171]:35370 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754431AbbLRPhb (ORCPT ); Fri, 18 Dec 2015 10:37:31 -0500 Subject: Re: [PATCH v2 05/11] tty: serial: 8250: Remove else after return To: Anton Wuerfel References: <1450437723-2978-1-git-send-email-anton.wuerfel@fau.de> <1450437723-2978-6-git-send-email-anton.wuerfel@fau.de> Cc: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , "James E.J. Bottomley" , Helge Deller , Heikki Krogerus , Andy Shevchenko , Qipeng Zha , Desmond Liu , Wang Long , Matt Redfearn , Paul Burton , Ralf Baechle , Krzysztof Kozlowski , Peter Hung , Soeren Grunewald , Adam Lee , "Maciej S. Szmigiero" , Mans Rullgard , linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linux-kernel@i4.cs.fau.de, Phillip Raffeck From: Peter Hurley Message-ID: <56742836.2050004@hurleysoftware.com> Date: Fri, 18 Dec 2015 07:37:26 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1450437723-2978-6-git-send-email-anton.wuerfel@fau.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/18/2015 03:21 AM, Anton Wuerfel wrote: > This patch fixes checkpatch warnings about unnecessary else blocks after > return statements. Reviewed-by: Peter Hurley See note below. > Signed-off-by: Anton Würfel > Signed-off-by: Phillip Raffeck > CC: linux-kernel@i4.cs.fau.de > --- > drivers/tty/serial/8250/8250_pci.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c > index 7f9f245..09157fa 100644 > --- a/drivers/tty/serial/8250/8250_pci.c > +++ b/drivers/tty/serial/8250/8250_pci.c > @@ -805,10 +805,10 @@ static int pci_netmos_9900_numports(struct pci_dev *dev) > > pi = (c & 0xff); > > - if (pi == 2) { > + if (pi == 2) > return 1; > - } else if ((pi == 0) && > - (dev->device == PCI_DEVICE_ID_NETMOS_9900)) { > + > + if ((pi == 0) && (dev->device == PCI_DEVICE_ID_NETMOS_9900)) { > /* two possibilities: 0x30ps encodes number of parallel and > * serial ports, or 0x1000 indicates *something*. This is not > * immediately obvious, since the 2s1p+4s configuration seems checkpatch missed this comment style because it's what netdev uses. Not a problem, though. We're not quite so formal here. > @@ -816,12 +816,11 @@ static int pci_netmos_9900_numports(struct pci_dev *dev) > * advertising the same function 3 as the 4s+2s1p config. > */ > sub_serports = dev->subsystem_device & 0xf; > - if (sub_serports > 0) { > + if (sub_serports > 0) > return sub_serports; > - } else { > - dev_err(&dev->dev, "NetMos/Mostech serial driver ignoring port on ambiguous config.\n"); > - return 0; > - } > + > + dev_err(&dev->dev, "NetMos/Mostech serial driver ignoring port on ambiguous config.\n"); > + return 0; > } > > moan_device("unknown NetMos/Mostech program interface", dev); > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Hurley Subject: Re: [PATCH v2 05/11] tty: serial: 8250: Remove else after return Date: Fri, 18 Dec 2015 07:37:26 -0800 Message-ID: <56742836.2050004@hurleysoftware.com> References: <1450437723-2978-1-git-send-email-anton.wuerfel@fau.de> <1450437723-2978-6-git-send-email-anton.wuerfel@fau.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1450437723-2978-6-git-send-email-anton.wuerfel@fau.de> Sender: linux-kernel-owner@vger.kernel.org To: Anton Wuerfel Cc: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , "James E.J. Bottomley" , Helge Deller , Heikki Krogerus , Andy Shevchenko , Qipeng Zha , Desmond Liu , Wang Long , Matt Redfearn , Paul Burton , Ralf Baechle , Krzysztof Kozlowski , Peter Hung , Soeren Grunewald , Adam Lee , "Maciej S. Szmigiero" , Mans Rullgard , linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linux-kernel@i4.cs.fau.de, Phillip Raffeck List-Id: linux-serial@vger.kernel.org On 12/18/2015 03:21 AM, Anton Wuerfel wrote: > This patch fixes checkpatch warnings about unnecessary else blocks af= ter > return statements. Reviewed-by: Peter Hurley See note below. > Signed-off-by: Anton W=C3=BCrfel > Signed-off-by: Phillip Raffeck > CC: linux-kernel@i4.cs.fau.de > --- > drivers/tty/serial/8250/8250_pci.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) >=20 > diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/= 8250/8250_pci.c > index 7f9f245..09157fa 100644 > --- a/drivers/tty/serial/8250/8250_pci.c > +++ b/drivers/tty/serial/8250/8250_pci.c > @@ -805,10 +805,10 @@ static int pci_netmos_9900_numports(struct pci_= dev *dev) > =20 > pi =3D (c & 0xff); > =20 > - if (pi =3D=3D 2) { > + if (pi =3D=3D 2) > return 1; > - } else if ((pi =3D=3D 0) && > - (dev->device =3D=3D PCI_DEVICE_ID_NETMOS_9900)) { > + > + if ((pi =3D=3D 0) && (dev->device =3D=3D PCI_DEVICE_ID_NETMOS_9900)= ) { > /* two possibilities: 0x30ps encodes number of parallel and > * serial ports, or 0x1000 indicates *something*. This is not > * immediately obvious, since the 2s1p+4s configuration seems checkpatch missed this comment style because it's what netdev uses. Not a problem, though. We're not quite so formal here. > @@ -816,12 +816,11 @@ static int pci_netmos_9900_numports(struct pci_= dev *dev) > * advertising the same function 3 as the 4s+2s1p config. > */ > sub_serports =3D dev->subsystem_device & 0xf; > - if (sub_serports > 0) { > + if (sub_serports > 0) > return sub_serports; > - } else { > - dev_err(&dev->dev, "NetMos/Mostech serial driver ignoring port on= ambiguous config.\n"); > - return 0; > - } > + > + dev_err(&dev->dev, "NetMos/Mostech serial driver ignoring port on = ambiguous config.\n"); > + return 0; > } > =20 > moan_device("unknown NetMos/Mostech program interface", dev); >=20