diff mbox

[v2,05/11] tty: serial: 8250: Remove else after return

Message ID 1450437723-2978-6-git-send-email-anton.wuerfel@fau.de (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Anton Wuerfel Dec. 18, 2015, 11:21 a.m. UTC
This patch fixes checkpatch warnings about unnecessary else blocks after
return statements.

Signed-off-by: Anton Würfel <anton.wuerfel@fau.de>
Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de>
CC: linux-kernel@i4.cs.fau.de
---
 drivers/tty/serial/8250/8250_pci.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

Comments

Peter Hurley Dec. 18, 2015, 3:37 p.m. UTC | #1
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 <peter@hurleysoftware.com>

See note below.

> Signed-off-by: Anton Würfel <anton.wuerfel@fau.de>
> Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de>
> 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);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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
@@ -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);