linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/4] serial: 8250_pci: Get rid of redundant 'else' keyword
Date: Tue, 13 Jul 2021 13:40:24 +0300	[thread overview]
Message-ID: <20210713104026.58560-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20210713104026.58560-1-andriy.shevchenko@linux.intel.com>

The 'else' keyword is not needed when previous conditional branch returns
to the upper layer. Get rid of redundant 'else' keyword in such cases.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/8250/8250_pci.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index b9138bd08b7f..937861327aca 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -515,7 +515,7 @@ static int pci_siig_init(struct pci_dev *dev)
 
 	if (type == 0x1000)
 		return pci_siig10x_init(dev);
-	else if (type == 0x2000)
+	if (type == 0x2000)
 		return pci_siig20x_init(dev);
 
 	moan_device("Unknown SIIG card", dev);
@@ -792,9 +792,9 @@ static int pci_netmos_9900_setup(struct serial_private *priv,
 		bar = 3 * idx;
 
 		return setup_port(priv, port, bar, 0, board->reg_shift);
-	} else {
-		return pci_default_setup(priv, board, port, idx);
 	}
+
+	return pci_default_setup(priv, board, port, idx);
 }
 
 /* the 99xx series comes with a range of device IDs and a variety
@@ -1361,9 +1361,10 @@ pericom_do_set_divisor(struct uart_port *port, unsigned int baud,
 			serial_port_out(port, 2, 16 - scr);
 			serial_port_out(port, UART_LCR, lcr);
 			return;
-		} else if (baud > actual_baud) {
-			break;
 		}
+
+		if (baud > actual_baud)
+			break;
 	}
 	serial8250_do_set_divisor(port, baud, quot, quot_frac);
 }
-- 
2.30.2


  reply	other threads:[~2021-07-13 10:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 10:40 [PATCH v1 1/4] serial: 8250_pci: Refactor the loop in pci_ite887x_init() Andy Shevchenko
2021-07-13 10:40 ` Andy Shevchenko [this message]
2021-07-13 10:40 ` [PATCH v1 3/4] serial: 8250_pci: Always try MSI/MSI-X Andy Shevchenko
2021-07-14  6:54   ` Jiri Slaby
2021-07-14  7:58     ` Jiri Slaby
2021-07-14  9:31       ` Andy Shevchenko
2021-07-14  9:15     ` Andy Shevchenko
2021-07-14 16:56       ` rwright
2021-07-14 12:49     ` [EXT] " Ralf Ramsauer
2021-07-14 13:35       ` Andy Shevchenko
2021-07-14 16:49         ` Ralf Ramsauer
2021-07-16 13:07         ` Ralf Ramsauer
2021-07-16 15:01           ` Andy Shevchenko
2021-07-16 15:27             ` Ralf Ramsauer
2021-07-16 17:27               ` Andy Shevchenko
2021-07-17 12:44                 ` Ralf Ramsauer
2021-07-13 10:40 ` [PATCH v1 4/4] serial: 8250_pci: Replace dev_*() by pci_*() macros Andy Shevchenko
2021-07-13 21:05   ` Joe Perches
2021-07-14  6:57 ` [PATCH v1 1/4] serial: 8250_pci: Refactor the loop in pci_ite887x_init() Jiri Slaby
2021-07-14 12:37   ` Andy Shevchenko
2021-07-14  8:07 ` Dan Carpenter
2021-07-14 10:44 ` Joe Perches
2021-07-14 12:36   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210713104026.58560-2-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).