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


Groups > linux.kernel > #1308598

[PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions

From Anton Wuerfel <anton.wuerfel@fau.de>
Newsgroups linux.kernel
Subject [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions
Date 2016-01-13 17:50 +0100
Message-ID <qQwMr-2sp-29@gated-at.bofh.it> (permalink)
References <qQwCK-2o0-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 1dd607f..50ab301 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -854,8 +854,10 @@ static int pci_netmos_init(struct pci_dev *dev)
 		}
 	}
 
-	if (num_serial == 0)
+	if (num_serial == 0) {
+		moan_device("unknown NetMos/Mostech device", dev);
 		return -ENODEV;
+	}
 
 	return num_serial;
 }
-- 
1.9.1

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


Thread

[PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
  [PATCH v5 09/15] tty: serial: 8250: Fix multi-line strings Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
    Re: [PATCH v5 09/15] tty: serial: 8250: Fix multi-line strings Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-13 18:20 +0100
  [PATCH v5 10/15] tty: serial: 8250: Suitably replace printk Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
  [PATCH v5 06/15] tty: serial: 8250: Move EXPORT_SYMBOL to function Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
  [PATCH v5 05/15] tty: serial: 8250: Remove else after return Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
    Re: [PATCH v5 05/15] tty: serial: 8250: Remove else after return Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-13 18:20 +0100
  [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
    Re: [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-13 18:40 +0100
  [PATCH v5 08/15] tty: serial: 8250: Add parentheses to macro Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
  [PATCH v5 01/15] tty: serial: 8250: Fix whitespace errors Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
  [PATCH v5 04/15] tty: serial: 8250: Fix multiline comment style Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
    Re: [PATCH v5 04/15] tty: serial: 8250: Fix multiline comment style Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-13 18:10 +0100
  [PATCH v5 13/15] tty: serial: 8250: Fix indentation warnings Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
  [PATCH v5 07/15] tty: serial: 8250: Fix line continuation warning Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
  [PATCH v5 12/15] tty: serial: 8250: Correct conversion specifiers Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
  [PATCH v5 03/15] tty: serial: 8250: Fix braces after struct Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100
  [PATCH v5 02/15] tty: serial: 8250: Replace spaces with tabs Anton Wuerfel <anton.wuerfel@fau.de> - 2016-01-13 17:50 +0100

csiph-web