From 829b0000242e3d2729972a034209afdd2b004456 Mon Sep 17 00:00:00 2001 From: Anton Wuerfel Date: Thu, 14 Jan 2016 16:08:22 +0100 Subject: [PATCH] tty: serial: 8250: Merge duplicate conditions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch refactors a switch case statement by merging an if condition in the default case into an identical condition right after the switch statement. This comes with a slight change in behaviour: If pci_netmos_9900_numports returns 0, an additional warning is printed. Signed-off-by: Anton Würfel Signed-off-by: Phillip Raffeck Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Cc: linux-kernel@i4.cs.fau.de Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index ec8a63573fd2..4b1c241e6f75 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -850,13 +850,13 @@ static int pci_netmos_init(struct pci_dev *dev) break; default: - if (num_serial == 0 ) { - moan_device("unknown NetMos/Mostech device", dev); - } + break; } - if (num_serial == 0) + if (num_serial == 0) { + moan_device("unknown NetMos/Mostech device", dev); return -ENODEV; + } return num_serial; } -- 2.39.5