Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1306150

Re: [PATCH v4 05/13] tty: serial: 8250: Remove else after return

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 05/13] tty: serial: 8250: Remove else after return
Date 2016-01-11 13:40 +0100
Message-ID <qPJVp-2ov-31@gated-at.bofh.it> (permalink)
References <qOJkJ-1BX-3@gated-at.bofh.it> <qOJkK-1BX-13@gated-at.bofh.it>
Organization Intel Finland Oy

Show all headers | View raw


On Fri, 2016-01-08 at 18:43 +0100, Anton Wuerfel wrote:
> This patch fixes checkpatch warnings about unnecessary else blocks
> after
> return statements.

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

And here the parens are redundant.

>  
> -	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))
> {

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v4 05/13] tty: serial: 8250: Remove else after return Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-08 18:50 +0100
  Re: [PATCH v4 05/13] tty: serial: 8250: Remove else after return Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-11 13:40 +0100

csiph-web