Re: [PATCH v5 05/15] tty: serial: 8250: Remove else after return

From: Andy Shevchenko
Date: Wed Jan 13 2016 - 12:11:24 EST


On Wed, 2016-01-13 at 17:39 +0100, Anton Wuerfel wrote:
> This patch fixes checkpatch warnings about unnecessary else blocks
> after
> return statements.
>

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

Here you may put the literal on the next line and indent it properly to
&. It might not fit the 80 character limit, but I think still worth to
do.

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy