linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings
@ 2016-01-13 16:39 Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 01/15] tty: serial: 8250: Fix whitespace errors Anton Wuerfel
                   ` (14 more replies)
  0 siblings, 15 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

Hello Andy,

thanks for your patch review. We tried to apply your suggested changes.

Regards,
Anton Wuerfel
Phillip Raffeck

This patch set fixes several checkpatch warnings in tty/serial/8250.

Patch 1/15:  Adds missing spaces (mainly to function/macro headers)
Patch 2/15:  Replace spaces with tabs wherever possible
Patch 3/15:  Slight patch which moves an opening curly brace
Patch 4/15:  Fixes multiline comment style
Patch 5/15:  Removes else blocks after return statements
Patch 6/15:  Slight patch which moves EXPORT_SYMBOL macro to correct
position
Patch 7/15:  Slight patch which removes an unneccessary line continuation
Patch 8/15:  Slight patch which adds parentheses to a macro definition
Patch 9/15:  Merges user-visible multiline strings to a single line
Patch 10/15: Replace printk by dev_* or pr_* where appropriate
Patch 11/15: Remove orphaned debug macro
Patch 12/15: Fix warnings in dev_dbg by adding two casts
Patch 13/15: Fixes code indentation
Patch 14/15: Add a generic port macro
Patch 15/15: Refactor a switch/case statement

Remaining checkpatch warnings after applying this patch series:

-line over 80 characters
	This error mostly occurs in serial_cs.c, which contains long-lined
	macro calls. However, splitting these calls into multiple lines would
	not increase readability.

-externs should be avoided in .c files
	This occurs in 8250_hp300.c. There is no corresponding header file
	the extern statement could be moved to. It could be moved to 8250.h
	but this would affect other .c files.

-Use #include <linux/*.h> instead of <asm/*.h>
	This warning has been left open for more experienced kernel hackers.
	This patch series is about style issues. We do not intend to alter
	the code behavior.
-struct uart_ops should normally be const
	This warning only occurs in 8250_core.c. The corresponding struct
	cannot be declared as const because it is altered in
	serial8250_isa_init_ports(). Maybe a checkpatch exception should
	be added for this particular warning.

-quoted string split across lines
	These strings were ignored because they otherwise would exceed
	80 characters in a single line. These particular strings use
	format specifiers, which break the ability to grep for them anyway.

Anton Wuerfel (15):
Phillip Raffeck (15):
  tty: serial: 8250: Fix whitespace errors
  tty: serial: 8250: Replace spaces with tabs
  tty: serial: 8250: Fix braces after struct
  tty: serial: 8250: Fix multiline comment style
  tty: serial: 8250: Remove else after return
  tty: serial: 8250: Move EXPORT_SYMBOL to function
  tty: serial: 8250: Fix line continuation warning
  tty: serial: 8250: Add parentheses to macro
  tty: serial: 8250: Fix multi-line strings
  tty: serial: 8250: Correct conversion specifiers
  tty: serial: 8250: Fix indentation warnings
  tty: serial: 8250: Add generic port init macro
  tty: serial: 8250: Merge duplicate conditions
  tty: serial: 8250: Suitably replace printk
  tty: serial: 8250: Remove SERIAL_DEBUG_PNP macro

 drivers/tty/serial/8250/8250.h               | 12 ++++
 drivers/tty/serial/8250/8250_accent.c        | 13 +---
 drivers/tty/serial/8250/8250_acorn.c         |  2 +-
 drivers/tty/serial/8250/8250_boca.c          | 41 ++++++-------
 drivers/tty/serial/8250/8250_core.c          | 15 ++---
 drivers/tty/serial/8250/8250_exar_st16c554.c | 17 ++----
 drivers/tty/serial/8250/8250_fourport.c      | 28 ++++-----
 drivers/tty/serial/8250/8250_gsc.c           |  7 ++-
 drivers/tty/serial/8250/8250_hp300.c         | 27 +++++----
 drivers/tty/serial/8250/8250_hub6.c          |  2 +-
 drivers/tty/serial/8250/8250_ingenic.c       | 12 ++--
 drivers/tty/serial/8250/8250_pci.c           | 55 +++++++++--------
 drivers/tty/serial/8250/8250_pnp.c           | 20 ++++---
 drivers/tty/serial/8250/8250_port.c          | 46 +++++++-------
 drivers/tty/serial/8250/serial_cs.c          | 89 +++++++++++++++-------------
 15 files changed, 195 insertions(+), 191 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v5 01/15] tty: serial: 8250: Fix whitespace errors
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 02/15] tty: serial: 8250: Replace spaces with tabs Anton Wuerfel
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

This patch fixes whitespace errors reported by checkpatch to increase
readability. Main focus is on missing spaces after commas in
function headers and macros (like foo,bar edited to foo, bar).

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_acorn.c |  2 +-
 drivers/tty/serial/8250/8250_hub6.c  |  2 +-
 drivers/tty/serial/8250/8250_pci.c   | 10 +++---
 drivers/tty/serial/8250/8250_port.c  |  2 ++
 drivers/tty/serial/8250/serial_cs.c  | 60 ++++++++++++++++++------------------
 5 files changed, 40 insertions(+), 36 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c
index 549aa07..402dfdd 100644
--- a/drivers/tty/serial/8250/8250_acorn.c
+++ b/drivers/tty/serial/8250/8250_acorn.c
@@ -70,7 +70,7 @@ serial_card_probe(struct expansion_card *ec, const struct ecard_id *id)
 	uart.port.regshift	= 2;
 	uart.port.dev	= &ec->dev;
 
-	for (i = 0; i < info->num_ports; i ++) {
+	for (i = 0; i < info->num_ports; i++) {
 		uart.port.membase = info->vaddr + type->offset[i];
 		uart.port.mapbase = bus_addr + type->offset[i];
 
diff --git a/drivers/tty/serial/8250/8250_hub6.c b/drivers/tty/serial/8250/8250_hub6.c
index a5c778e..27124e2 100644
--- a/drivers/tty/serial/8250/8250_hub6.c
+++ b/drivers/tty/serial/8250/8250_hub6.c
@@ -10,7 +10,7 @@
 #include <linux/init.h>
 #include <linux/serial_8250.h>
 
-#define HUB6(card,port)							\
+#define HUB6(card, port)						\
 	{								\
 		.iobase		= 0x302,				\
 		.irq		= 3,					\
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 4097f3f..ccf43cb 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -850,7 +850,7 @@ static int pci_netmos_init(struct pci_dev *dev)
 			break;
 
 		default:
-			if (num_serial == 0 ) {
+			if (num_serial == 0) {
 				moan_device("unknown NetMos/Mostech device", dev);
 			}
 	}
@@ -1198,8 +1198,9 @@ static int pci_quatech_has_qmcr(struct uart_8250_port *port)
 
 static int pci_quatech_test(struct uart_8250_port *port)
 {
-	u8 reg;
-	u8 qopr = pci_quatech_rqopr(port);
+	u8 reg, qopr;
+
+	qopr = pci_quatech_rqopr(port);
 	pci_quatech_wqopr(port, qopr & QPCR_TEST_FOR1);
 	reg = pci_quatech_rqopr(port) & 0xC0;
 	if (reg != QPCR_TEST_GET1)
@@ -1286,6 +1287,7 @@ static int pci_quatech_init(struct pci_dev *dev)
 		unsigned long base = pci_resource_start(dev, 0);
 		if (base) {
 			u32 tmp;
+
 			outl(inl(base + 0x38) | 0x00002000, base + 0x38);
 			tmp = inl(base + 0x3c);
 			outl(tmp | 0x01000000, base + 0x3c);
@@ -4502,7 +4504,7 @@ static struct pci_device_id serial_pci_tbl[] = {
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b0_bt_2_921600 },
 	{	PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI958,
-		PCI_ANY_ID , PCI_ANY_ID, 0, 0,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b2_8_1152000 },
 
 	/*
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 52d82d2..7f3bd7b 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1327,6 +1327,7 @@ static void serial8250_start_tx(struct uart_port *port)
 
 		if (up->bugs & UART_BUG_TXEN) {
 			unsigned char lsr;
+
 			lsr = serial_in(up, UART_LSR);
 			up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
 			if (lsr & UART_LSR_THRE)
@@ -1734,6 +1735,7 @@ static void wait_for_xmitr(struct uart_8250_port *up, int bits)
 	/* Wait up to 1s for flow control if necessary */
 	if (up->port.flags & UPF_CONS_FLOW) {
 		unsigned int tmout;
+
 		for (tmout = 1000000; tmout; tmout--) {
 			unsigned int msr = serial_in(up, UART_MSR);
 			up->msr_saved_flags |= msr & MSR_SAVE_FLAGS;
diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index 4d180c9..6d7a801 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -28,7 +28,7 @@
     and other provisions required by the GPL.  If you do not delete
     the provisions above, a recipient may use your version of this
     file under either the MPL or the GPL.
-    
+
 ======================================================================*/
 
 #include <linux/module.h>
@@ -257,7 +257,7 @@ static const struct serial_quirk quirks[] = {
 };
 
 
-static int serial_config(struct pcmcia_device * link);
+static int serial_config(struct pcmcia_device *link);
 
 
 static void serial_remove(struct pcmcia_device *link)
@@ -309,7 +309,7 @@ static int serial_probe(struct pcmcia_device *link)
 	dev_dbg(&link->dev, "serial_attach()\n");
 
 	/* Create new serial device */
-	info = kzalloc(sizeof (*info), GFP_KERNEL);
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info)
 		return -ENOMEM;
 	info->p_dev = link;
@@ -339,7 +339,7 @@ static void serial_detach(struct pcmcia_device *link)
 
 /*====================================================================*/
 
-static int setup_serial(struct pcmcia_device *handle, struct serial_info * info,
+static int setup_serial(struct pcmcia_device *handle, struct serial_info *info,
 			unsigned int iobase, int irq)
 {
 	struct uart_8250_port uart;
@@ -600,7 +600,7 @@ static int serial_check_for_multi(struct pcmcia_device *p_dev,  void *priv_data)
 }
 
 
-static int serial_config(struct pcmcia_device * link)
+static int serial_config(struct pcmcia_device *link)
 {
 	struct serial_info *info = link->priv;
 	int i;
@@ -701,7 +701,7 @@ static const struct pcmcia_device_id serial_ids[] = {
 	PCMCIA_PFC_DEVICE_PROD_ID12(1, "LINKSYS", "PCMLM336", 0xf7cb0b07, 0x7a821b58),
 	PCMCIA_PFC_DEVICE_PROD_ID12(1, "MEGAHERTZ", "XJEM1144/CCEM1144", 0xf510db04, 0x52d21e1e),
 	PCMCIA_PFC_DEVICE_PROD_ID12(1, "MICRO RESEARCH", "COMBO-L/M-336", 0xb2ced065, 0x3ced0555),
-	PCMCIA_PFC_DEVICE_PROD_ID12(1, "NEC", "PK-UG-J001" ,0x18df0ba0 ,0x831b1064),
+	PCMCIA_PFC_DEVICE_PROD_ID12(1, "NEC", "PK-UG-J001", 0x18df0ba0, 0x831b1064),
 	PCMCIA_PFC_DEVICE_PROD_ID12(1, "Ositech", "Trumpcard:Jack of Diamonds Modem+Ethernet", 0xc2f80cd, 0x656947b9),
 	PCMCIA_PFC_DEVICE_PROD_ID12(1, "Ositech", "Trumpcard:Jack of Hearts Modem+Ethernet", 0xc2f80cd, 0xdc9ba5ed),
 	PCMCIA_PFC_DEVICE_PROD_ID12(1, "PCMCIAs", "ComboCard", 0xdcfe12d3, 0xcd8906cc),
@@ -797,30 +797,30 @@ static const struct pcmcia_device_id serial_ids[] = {
 	PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "cis/COMpad2.cis"),
 	PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "cis/RS-COM-2P.cis"),
 	PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "cis/GLOBETROTTER.cis"),
-	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL100  1.00.",0x19ca78af,0xf964f42b),
-	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL100",0x19ca78af,0x71d98e83),
-	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL232  1.00.",0x19ca78af,0x69fb7490),
-	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL232",0x19ca78af,0xb6bc0235),
-	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c2000.","SERIAL CARD: CF232",0x63f2e0bd,0xb9e175d3),
-	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c2000.","SERIAL CARD: CF232-5",0x63f2e0bd,0xfce33442),
-	PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: CF232",0x3beb8cf2,0x171e7190),
-	PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: CF232-5",0x3beb8cf2,0x20da4262),
-	PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: CF428",0x3beb8cf2,0xea5dd57d),
-	PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: CF500",0x3beb8cf2,0xd77255fa),
-	PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: IC232",0x3beb8cf2,0x6a709903),
-	PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: SL232",0x3beb8cf2,0x18430676),
-	PCMCIA_DEVICE_PROD_ID12("Elan","Serial Port: XL232",0x3beb8cf2,0x6f933767),
-	PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial Port: CF332",0x3beb8cf2,0x16dc1ba7),
-	PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial Port: SL332",0x3beb8cf2,0x19816c41),
-	PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial Port: SL385",0x3beb8cf2,0x64112029),
-	PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4),
-	PCMCIA_MFC_DEVICE_PROD_ID12(0,"Elan","Serial+Parallel Port: SP230",0x3beb8cf2,0xdb9e58bc),
-	PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial Port: CF332",0x3beb8cf2,0x16dc1ba7),
-	PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial Port: SL332",0x3beb8cf2,0x19816c41),
-	PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial Port: SL385",0x3beb8cf2,0x64112029),
-	PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4),
-	PCMCIA_MFC_DEVICE_PROD_ID12(2,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4),
-	PCMCIA_MFC_DEVICE_PROD_ID12(3,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4),
+	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL100  1.00.", 0x19ca78af, 0xf964f42b),
+	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL100", 0x19ca78af, 0x71d98e83),
+	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL232  1.00.", 0x19ca78af, 0x69fb7490),
+	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.", "SERIAL CARD: SL232", 0x19ca78af, 0xb6bc0235),
+	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c2000.", "SERIAL CARD: CF232", 0x63f2e0bd, 0xb9e175d3),
+	PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c2000.", "SERIAL CARD: CF232-5", 0x63f2e0bd, 0xfce33442),
+	PCMCIA_DEVICE_PROD_ID12("Elan", "Serial Port: CF232", 0x3beb8cf2, 0x171e7190),
+	PCMCIA_DEVICE_PROD_ID12("Elan", "Serial Port: CF232-5", 0x3beb8cf2, 0x20da4262),
+	PCMCIA_DEVICE_PROD_ID12("Elan", "Serial Port: CF428", 0x3beb8cf2, 0xea5dd57d),
+	PCMCIA_DEVICE_PROD_ID12("Elan", "Serial Port: CF500", 0x3beb8cf2, 0xd77255fa),
+	PCMCIA_DEVICE_PROD_ID12("Elan", "Serial Port: IC232", 0x3beb8cf2, 0x6a709903),
+	PCMCIA_DEVICE_PROD_ID12("Elan", "Serial Port: SL232", 0x3beb8cf2, 0x18430676),
+	PCMCIA_DEVICE_PROD_ID12("Elan", "Serial Port: XL232", 0x3beb8cf2, 0x6f933767),
+	PCMCIA_MFC_DEVICE_PROD_ID12(0, "Elan", "Serial Port: CF332", 0x3beb8cf2, 0x16dc1ba7),
+	PCMCIA_MFC_DEVICE_PROD_ID12(0, "Elan", "Serial Port: SL332", 0x3beb8cf2, 0x19816c41),
+	PCMCIA_MFC_DEVICE_PROD_ID12(0, "Elan", "Serial Port: SL385", 0x3beb8cf2, 0x64112029),
+	PCMCIA_MFC_DEVICE_PROD_ID12(0, "Elan", "Serial Port: SL432", 0x3beb8cf2, 0x1cce7ac4),
+	PCMCIA_MFC_DEVICE_PROD_ID12(0, "Elan", "Serial+Parallel Port: SP230", 0x3beb8cf2, 0xdb9e58bc),
+	PCMCIA_MFC_DEVICE_PROD_ID12(1, "Elan", "Serial Port: CF332", 0x3beb8cf2, 0x16dc1ba7),
+	PCMCIA_MFC_DEVICE_PROD_ID12(1, "Elan", "Serial Port: SL332", 0x3beb8cf2, 0x19816c41),
+	PCMCIA_MFC_DEVICE_PROD_ID12(1, "Elan", "Serial Port: SL385", 0x3beb8cf2, 0x64112029),
+	PCMCIA_MFC_DEVICE_PROD_ID12(1, "Elan", "Serial Port: SL432", 0x3beb8cf2, 0x1cce7ac4),
+	PCMCIA_MFC_DEVICE_PROD_ID12(2, "Elan", "Serial Port: SL432", 0x3beb8cf2, 0x1cce7ac4),
+	PCMCIA_MFC_DEVICE_PROD_ID12(3, "Elan", "Serial Port: SL432", 0x3beb8cf2, 0x1cce7ac4),
 	PCMCIA_DEVICE_MANF_CARD(0x0279, 0x950b),
 	/* too generic */
 	/* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 02/15] tty: serial: 8250: Replace spaces with tabs
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 01/15] tty: serial: 8250: Fix whitespace errors Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 03/15] tty: serial: 8250: Fix braces after struct Anton Wuerfel
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

Indentation is changed to match the correct format of using tabs instead
of spaces wherever possible.

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  | 12 ++++++------
 drivers/tty/serial/8250/8250_port.c |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index ccf43cb..7f9f245 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -721,7 +721,7 @@ static int pci_ni8430_init(struct pci_dev *dev)
 	 */
 	pcibios_resource_to_bus(dev->bus, &region, &dev->resource[bar]);
 	device_window = ((region.start + MITE_IOWBSR1_WIN_OFFSET) & 0xffffff00)
-	                | MITE_IOWBSR1_WENAB | MITE_IOWBSR1_WSIZE;
+			| MITE_IOWBSR1_WENAB | MITE_IOWBSR1_WSIZE;
 	writel(device_window, p + MITE_IOWBSR1);
 
 	/* Set window access to go to RAMSEL IO address space */
@@ -1763,7 +1763,7 @@ xr17v35x_has_slave(struct serial_private *priv)
 	const int dev_id = priv->dev->device;
 
 	return ((dev_id == PCI_DEVICE_ID_EXAR_XR17V4358) ||
-	        (dev_id == PCI_DEVICE_ID_EXAR_XR17V8358));
+		(dev_id == PCI_DEVICE_ID_EXAR_XR17V8358));
 }
 
 static int
@@ -1863,8 +1863,8 @@ pci_fastcom335_setup(struct serial_private *priv,
 
 static int
 pci_wch_ch353_setup(struct serial_private *priv,
-                    const struct pciserial_board *board,
-                    struct uart_8250_port *port, int idx)
+		    const struct pciserial_board *board,
+		    struct uart_8250_port *port, int idx)
 {
 	port->port.flags |= UPF_FIXED_TYPE;
 	port->port.type = PORT_16550A;
@@ -1873,8 +1873,8 @@ pci_wch_ch353_setup(struct serial_private *priv,
 
 static int
 pci_wch_ch38x_setup(struct serial_private *priv,
-                    const struct pciserial_board *board,
-                    struct uart_8250_port *port, int idx)
+		    const struct pciserial_board *board,
+		    struct uart_8250_port *port, int idx)
 {
 	port->port.flags |= UPF_FIXED_TYPE;
 	port->port.type = PORT_16850;
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 7f3bd7b..f2e588e 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -52,7 +52,7 @@
 #define DEBUG_AUTOCONF(fmt...)	do { } while (0)
 #endif
 
-#define BOTH_EMPTY 	(UART_LSR_TEMT | UART_LSR_THRE)
+#define BOTH_EMPTY	(UART_LSR_TEMT | UART_LSR_THRE)
 
 /*
  * Here we define the default xmit fifo size used for each type of UART.
@@ -2254,7 +2254,7 @@ serial8250_get_baud_rate(struct uart_port *port, struct ktermios *termios,
 
 void
 serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
-		          struct ktermios *old)
+			  struct ktermios *old)
 {
 	struct uart_8250_port *up = up_to_u8250p(port);
 	unsigned char cval;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 03/15] tty: serial: 8250: Fix braces after struct
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 01/15] tty: serial: 8250: Fix whitespace errors Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 02/15] tty: serial: 8250: Replace spaces with tabs Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 04/15] tty: serial: 8250: Fix multiline comment style Anton Wuerfel
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

This patch fixes a checkpatch warning by moving an opening curly brace
to its correct position.

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_hp300.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c
index 2891958..5e1b464 100644
--- a/drivers/tty/serial/8250/8250_hp300.c
+++ b/drivers/tty/serial/8250/8250_hp300.c
@@ -24,8 +24,7 @@
 #endif
 
 #ifdef CONFIG_HPAPCI
-struct hp300_port
-{
+struct hp300_port {
 	struct hp300_port *next;	/* next port */
 	int line;			/* line (tty) number */
 };
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 04/15] tty: serial: 8250: Fix multiline comment style
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (2 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 03/15] tty: serial: 8250: Fix braces after struct Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 17:03   ` Andy Shevchenko
  2016-01-13 16:39 ` [PATCH v5 05/15] tty: serial: 8250: Remove else after return Anton Wuerfel
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

Checkpatch outputs some warnings about incorrect comment style,
which is fixed by this patch.

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_ingenic.c | 12 ++++++++----
 drivers/tty/serial/8250/8250_pnp.c     |  6 ++++--
 drivers/tty/serial/8250/8250_port.c    | 31 ++++++++++++++++---------------
 drivers/tty/serial/8250/serial_cs.c    | 26 +++++++++++++++++---------
 4 files changed, 45 insertions(+), 30 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c
index 49394b4..086bd00 100644
--- a/drivers/tty/serial/8250/8250_ingenic.c
+++ b/drivers/tty/serial/8250/8250_ingenic.c
@@ -152,14 +152,18 @@ static void ingenic_uart_serial_out(struct uart_port *p, int offset, int value)
 		break;
 
 	case UART_IER:
-		/* Enable receive timeout interrupt with the
-		 * receive line status interrupt */
+		/*
+		 * Enable receive timeout interrupt with the
+		 * receive line status interrupt
+		 */
 		value |= (value & 0x4) << 2;
 		break;
 
 	case UART_MCR:
-		/* If we have enabled modem status IRQs we should enable modem
-		 * mode. */
+		/*
+		 * If we have enabled modem status IRQs we should enable modem
+		 * mode.
+		 */
 		ier = p->serial_in(p, UART_IER);
 
 		if (ier & UART_IER_MSI)
diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index 658b392..ffa7354 100644
--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -367,8 +367,10 @@ static const struct pnp_device_id pnp_dev_table[] = {
 	{	"PNPCXXX",		UNKNOWN_DEV	},
 	/* More unknown PnP modems */
 	{	"PNPDXXX",		UNKNOWN_DEV	},
-	/* Winbond CIR port, should not be probed. We should keep track
-	   of it to prevent the legacy serial driver from probing it */
+	/*
+	 * Winbond CIR port, should not be probed. We should keep track
+	 * of it to prevent the legacy serial driver from probing it
+	 */
 	{	"WEC1022",		CIR_PORT	},
 	/*
 	 * SMSC IrCC SIR/FIR port, should not be probed by serial driver
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index f2e588e..99f709c 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -250,9 +250,11 @@ static const struct serial8250_config uart_config[] = {
 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
 		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
 	},
-/* tx_loadsz is set to 63-bytes instead of 64-bytes to implement
-workaround of errata A-008006 which states that tx_loadsz should  be
-configured less than Maximum supported fifo bytes */
+	/*
+	 * tx_loadsz is set to 63-bytes instead of 64-bytes to implement
+	 * workaround of errata A-008006 which states that tx_loadsz should be
+	 * configured less than Maximum supported fifo bytes
+	 */
 	[PORT_16550A_FSL64] = {
 		.name		= "16550A_FSL64",
 		.fifo_size	= 64,
@@ -1969,23 +1971,22 @@ int serial8250_do_startup(struct uart_port *port)
 
 	serial8250_set_mctrl(port, port->mctrl);
 
-	/* Serial over Lan (SoL) hack:
-	   Intel 8257x Gigabit ethernet chips have a
-	   16550 emulation, to be used for Serial Over Lan.
-	   Those chips take a longer time than a normal
-	   serial device to signalize that a transmission
-	   data was queued. Due to that, the above test generally
-	   fails. One solution would be to delay the reading of
-	   iir. However, this is not reliable, since the timeout
-	   is variable. So, let's just don't test if we receive
-	   TX irq. This way, we'll never enable UART_BUG_TXEN.
+	/*
+	 * Serial over Lan (SoL) hack:
+	 * Intel 8257x Gigabit ethernet chips have a 16550 emulation, to be used
+	 * for Serial Over Lan.  Those chips take a longer time than a normal
+	 * serial device to signalize that a transmission data was queued. Due
+	 * to that, the above test generally fails. One solution would be to
+	 * delay the reading of iir. However, this is not reliable, since the
+	 * timeout is variable. So, let's just don't test if we receive TX irq.
+	 * This way, we'll never enable UART_BUG_TXEN.
 	 */
 	if (up->port.flags & UPF_NO_TXEN_TEST)
 		goto dont_test_tx_en;
 
 	/*
-	 * Do a quick test to see if we receive an
-	 * interrupt when we enable the TX irq.
+	 * Do a quick test to see if we receive an interrupt when we enable the
+	 * TX irq.
 	 */
 	serial_port_out(port, UART_IER, UART_IER_THRI);
 	lsr = serial_port_in(port, UART_LSR);
diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index 6d7a801..1f34867 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -441,16 +441,20 @@ static int simple_config(struct pcmcia_device *link)
 	struct serial_info *info = link->priv;
 	int i = -ENODEV, try;
 
-	/* First pass: look for a config entry that looks normal.
-	 * Two tries: without IO aliases, then with aliases */
+	/*
+	 * First pass: look for a config entry that looks normal.
+	 * Two tries: without IO aliases, then with aliases
+	 */
 	link->config_flags |= CONF_AUTO_SET_VPP;
 	for (try = 0; try < 4; try++)
 		if (!pcmcia_loop_config(link, simple_config_check, &try))
 			goto found_port;
 
-	/* Second pass: try to find an entry that isn't picky about
-	   its base address, then try to grab any standard serial port
-	   address, and finally try to get any free port. */
+	/*
+	 * Second pass: try to find an entry that isn't picky about
+	 * its base address, then try to grab any standard serial port
+	 * address, and finally try to get any free port.
+	 */
 	if (!pcmcia_loop_config(link, simple_config_check_notpicky, NULL))
 		goto found_port;
 
@@ -480,8 +484,10 @@ static int multi_config_check(struct pcmcia_device *p_dev, void *priv_data)
 	if (p_dev->resource[1]->end)
 		return -EINVAL;
 
-	/* The quad port cards have bad CIS's, so just look for a
-	   window larger than 8 ports and assume it will be right */
+	/*
+	 * The quad port cards have bad CIS's, so just look for a
+	 * window larger than 8 ports and assume it will be right
+	 */
 	if (p_dev->resource[0]->end <= 8)
 		return -EINVAL;
 
@@ -623,8 +629,10 @@ static int serial_config(struct pcmcia_device *link)
 			break;
 		}
 
-	/* Another check for dual-serial cards: look for either serial or
-	   multifunction cards that ask for appropriate IO port ranges */
+	/*
+	 * Another check for dual-serial cards: look for either serial or
+	 * multifunction cards that ask for appropriate IO port ranges
+	 */
 	if ((info->multi == 0) &&
 	    (link->has_func_id) &&
 	    (link->socket->pcmcia_pfc == 0) &&
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 05/15] tty: serial: 8250: Remove else after return
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (3 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 04/15] tty: serial: 8250: Fix multiline comment style Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 17:05   ` Andy Shevchenko
  2016-01-13 16:39 ` [PATCH v5 06/15] tty: serial: 8250: Move EXPORT_SYMBOL to function Anton Wuerfel
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

This patch fixes checkpatch warnings about unnecessary else blocks after
return statements.

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 | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 7f9f245..09157fa 100644
--- 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);
 
-	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)) {
 		/* two possibilities: 0x30ps encodes number of parallel and
 		 * serial ports, or 0x1000 indicates *something*. This is not
 		 * immediately obvious, since the 2s1p+4s configuration seems
@@ -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");
+		return 0;
 	}
 
 	moan_device("unknown NetMos/Mostech program interface", dev);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 06/15] tty: serial: 8250: Move EXPORT_SYMBOL to function
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (4 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 05/15] tty: serial: 8250: Remove else after return Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 07/15] tty: serial: 8250: Fix line continuation warning Anton Wuerfel
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

This patch moves EXPORT_SYMBOL macros directly after the definition of
the corresponding symbol to remove checkpatch warnings.

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_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 3912646..15082ae 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -763,6 +763,7 @@ void serial8250_suspend_port(int line)
 
 	uart_suspend_port(&serial8250_reg, port);
 }
+EXPORT_SYMBOL(serial8250_suspend_port);
 
 /**
  *	serial8250_resume_port - resume one serial port
@@ -788,6 +789,7 @@ void serial8250_resume_port(int line)
 	}
 	uart_resume_port(&serial8250_reg, port);
 }
+EXPORT_SYMBOL(serial8250_resume_port);
 
 /*
  * Register a set of serial devices attached to a platform device.  The
@@ -1167,9 +1169,6 @@ static void __exit serial8250_exit(void)
 module_init(serial8250_init);
 module_exit(serial8250_exit);
 
-EXPORT_SYMBOL(serial8250_suspend_port);
-EXPORT_SYMBOL(serial8250_resume_port);
-
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Generic 8250/16x50 serial driver");
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 07/15] tty: serial: 8250: Fix line continuation warning
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (5 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 06/15] tty: serial: 8250: Move EXPORT_SYMBOL to function Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 08/15] tty: serial: 8250: Add parentheses to macro Anton Wuerfel
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

Fixed checkpatch warning about an unnecessary line continuation in a
multi-line variable assignment.

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_hp300.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c
index 5e1b464..cf566bb 100644
--- a/drivers/tty/serial/8250/8250_hp300.c
+++ b/drivers/tty/serial/8250/8250_hp300.c
@@ -248,8 +248,8 @@ static int __init hp300_8250_init(void)
 
 		/* Memory mapped I/O */
 		uart.port.iotype = UPIO_MEM;
-		uart.port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ \
-			      | UPF_BOOT_AUTOCONF;
+		uart.port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ
+				| UPF_BOOT_AUTOCONF;
 		/* XXX - no interrupt support yet */
 		uart.port.irq = 0;
 		uart.port.uartclk = HPAPCI_BAUD_BASE * 16;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 08/15] tty: serial: 8250: Add parentheses to macro
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (6 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 07/15] tty: serial: 8250: Fix line continuation warning Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 09/15] tty: serial: 8250: Fix multi-line strings Anton Wuerfel
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

This patch fixes a checkpatch warning caused by missing parentheses
in the definition of a macro.
Furthermore redundant parentheses are removed in an assignment.

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_core.c | 2 +-
 drivers/tty/serial/8250/8250_pci.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 15082ae..d042ad5 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -686,7 +686,7 @@ static int __init univ8250_console_init(void)
 }
 console_initcall(univ8250_console_init);
 
-#define SERIAL8250_CONSOLE	&univ8250_console
+#define SERIAL8250_CONSOLE	(&univ8250_console)
 #else
 #define SERIAL8250_CONSOLE	NULL
 #endif
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 09157fa..433afdd 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -803,7 +803,7 @@ static int pci_netmos_9900_numports(struct pci_dev *dev)
 	unsigned int pi;
 	unsigned short sub_serports;
 
-	pi = (c & 0xff);
+	pi = c & 0xff;
 
 	if (pi == 2)
 		return 1;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 09/15] tty: serial: 8250: Fix multi-line strings
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (7 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 08/15] tty: serial: 8250: Add parentheses to macro Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 17:08   ` Andy Shevchenko
  2016-01-13 16:39 ` [PATCH v5 10/15] tty: serial: 8250: Suitably replace printk Anton Wuerfel
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

Merged user-visible multi-line strings into a single line according to the
Linux Kernel Coding Style, which allows user-visible strings to exceed the
maximum line length of 80 characters. The main reason for this is to
facilitate grepping for these strings.
However, some strings were ignored in this patch, because the use of
format specifiers breaks the ability to grep anyway.

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_core.c | 3 +--
 drivers/tty/serial/8250/serial_cs.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index d042ad5..b60b58b 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1173,8 +1173,7 @@ MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Generic 8250/16x50 serial driver");
 
 module_param(share_irqs, uint, 0644);
-MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices"
-	" (unsafe)");
+MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices (unsafe)");
 
 module_param(nr_uarts, uint, 0644);
 MODULE_PARM_DESC(nr_uarts, "Maximum number of UARTs supported. (1-" __MODULE_STRING(CONFIG_SERIAL_8250_NR_UARTS) ")");
diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index 1f34867..1ab6bfc 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -533,8 +533,7 @@ static int multi_config(struct pcmcia_device *link)
 		info->multi = 2;
 		if (pcmcia_loop_config(link, multi_config_check_notpicky,
 				       &base2)) {
-			dev_warn(&link->dev, "no usable port range "
-			       "found, giving up\n");
+			dev_warn(&link->dev, "no usable port range found, giving up\n");
 			return -ENODEV;
 		}
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 10/15] tty: serial: 8250: Suitably replace printk
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (8 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 09/15] tty: serial: 8250: Fix multi-line strings Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 11/15] tty: serial: 8250: Remove SERIAL_DEBUG_PNP macro Anton Wuerfel
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Würfel

From: Phillip Raffeck <phillip.raffeck@fau.de>

This patch replaces printk by the corresponding variant of dev_* in order
to fix checkpatch warnings. If no suitable device pointer is present, the
corresponding pr_* variant is used.

Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de>
Signed-off-by: Anton Würfel <anton.wuerfel@fau.de>
Cc: linux-kernel@i4.cs.fau.de
---
 drivers/tty/serial/8250/8250_core.c  |  5 ++---
 drivers/tty/serial/8250/8250_gsc.c   |  7 ++++---
 drivers/tty/serial/8250/8250_hp300.c | 20 +++++++++++---------
 drivers/tty/serial/8250/8250_port.c  |  3 +--
 4 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index b60b58b..d6b4906 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1094,9 +1094,8 @@ static int __init serial8250_init(void)
 
 	serial8250_isa_init_ports();
 
-	printk(KERN_INFO "Serial: 8250/16550 driver, "
-		"%d ports, IRQ sharing %sabled\n", nr_uarts,
-		share_irqs ? "en" : "dis");
+	pr_info("Serial: 8250/16550 driver, %d ports, IRQ sharing %sabled\n",
+		nr_uarts, share_irqs ? "en" : "dis");
 
 #ifdef CONFIG_SPARC
 	ret = sunserial_register_minors(&serial8250_reg, UART_NR);
diff --git a/drivers/tty/serial/8250/8250_gsc.c b/drivers/tty/serial/8250/8250_gsc.c
index 2e3ea1a..b1e6ae9 100644
--- a/drivers/tty/serial/8250/8250_gsc.c
+++ b/drivers/tty/serial/8250/8250_gsc.c
@@ -42,7 +42,7 @@ static int __init serial_init_chip(struct parisc_device *dev)
 		 * the user what they're missing.
 		 */
 		if (parisc_parent(dev)->id.hw_type != HPHW_IOA)
-			printk(KERN_INFO
+			dev_info(&dev->dev,
 				"Serial: device 0x%llx not configured.\n"
 				"Enable support for Wax, Lasi, Asp or Dino.\n",
 				(unsigned long long)dev->hpa.start);
@@ -66,8 +66,9 @@ static int __init serial_init_chip(struct parisc_device *dev)
 
 	err = serial8250_register_8250_port(&uart);
 	if (err < 0) {
-		printk(KERN_WARNING
-			"serial8250_register_8250_port returned error %d\n", err);
+		dev_warn(&dev->dev,
+			"serial8250_register_8250_port returned error %d\n",
+			err);
 		iounmap(uart.port.membase);
 		return err;
 	}
diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c
index cf566bb..38166db 100644
--- a/drivers/tty/serial/8250/8250_hp300.c
+++ b/drivers/tty/serial/8250/8250_hp300.c
@@ -110,7 +110,7 @@ int __init hp300_setup_serial_console(void)
 	/* Check for APCI console */
 	if (scode == 256) {
 #ifdef CONFIG_HPAPCI
-		printk(KERN_INFO "Serial console is HP APCI 1\n");
+		pr_info("Serial console is HP APCI 1\n");
 
 		port.uartclk = HPAPCI_BAUD_BASE * 16;
 		port.mapbase = (FRODO_BASE + FRODO_APCI_OFFSET(1));
@@ -118,7 +118,7 @@ int __init hp300_setup_serial_console(void)
 		port.regshift = 2;
 		add_preferred_console("ttyS", port.line, "9600n8");
 #else
-		printk(KERN_WARNING "Serial console is APCI but support is disabled (CONFIG_HPAPCI)!\n");
+		pr_warn("Serial console is APCI but support is disabled (CONFIG_HPAPCI)!\n");
 		return 0;
 #endif
 	} else {
@@ -127,7 +127,7 @@ int __init hp300_setup_serial_console(void)
 		if (!pa)
 			return 0;
 
-		printk(KERN_INFO "Serial console is HP DCA at select code %d\n", scode);
+		pr_info("Serial console is HP DCA at select code %d\n", scode);
 
 		port.uartclk = HPDCA_BAUD_BASE * 16;
 		port.mapbase = (pa + UART_OFFSET);
@@ -141,13 +141,13 @@ int __init hp300_setup_serial_console(void)
 		if (DIO_ID(pa + DIO_VIRADDRBASE) & 0x80)
 			add_preferred_console("ttyS", port.line, "9600n8");
 #else
-		printk(KERN_WARNING "Serial console is DCA but support is disabled (CONFIG_HPDCA)!\n");
+		pr_warn("Serial console is DCA but support is disabled (CONFIG_HPDCA)!\n");
 		return 0;
 #endif
 	}
 
 	if (early_serial_setup(&port) < 0)
-		printk(KERN_WARNING "hp300_setup_serial_console(): early_serial_setup() failed.\n");
+		pr_warn("%s: early_serial_setup() failed.\n", __func__);
 	return 0;
 }
 #endif /* CONFIG_SERIAL_8250_CONSOLE */
@@ -179,8 +179,9 @@ static int hpdca_init_one(struct dio_dev *d,
 	line = serial8250_register_8250_port(&uart);
 
 	if (line < 0) {
-		printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d"
-		       " irq %d failed\n", d->scode, uart.port.irq);
+		dev_notice(&d->dev,
+			  "8250_hp300: register_serial() DCA scode %d irq %d failed\n",
+			  d->scode, uart.port.irq);
 		return -ENOMEM;
 	}
 
@@ -260,8 +261,9 @@ static int __init hp300_8250_init(void)
 		line = serial8250_register_8250_port(&uart);
 
 		if (line < 0) {
-			printk(KERN_NOTICE "8250_hp300: register_serial() APCI"
-			       " %d irq %d failed\n", i, uart.port.irq);
+			dev_notice(uart.port.dev,
+				   "8250_hp300: register_serial() APCI %d irq %d failed\n",
+				   i, uart.port.irq);
 			kfree(port);
 			continue;
 		}
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 99f709c..343d050 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1222,8 +1222,7 @@ static void autoconfig(struct uart_8250_port *up)
 out_lock:
 	spin_unlock_irqrestore(&port->lock, flags);
 	if (up->capabilities != old_capabilities) {
-		printk(KERN_WARNING
-		       "ttyS%d: detected caps %08x should be %08x\n",
+		pr_warn("ttyS%d: detected caps %08x should be %08x\n",
 		       serial_index(port), old_capabilities,
 		       up->capabilities);
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 11/15] tty: serial: 8250: Remove SERIAL_DEBUG_PNP macro
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (9 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 10/15] tty: serial: 8250: Suitably replace printk Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 12/15] tty: serial: 8250: Correct conversion specifiers Anton Wuerfel
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Würfel

From: Phillip Raffeck <phillip.raffeck@fau.de>

This patch removes the macro SERIAL_DEBUG_PNP, which is used to enable
debugging at compile time.
As SERIAL_DEBUG_PNP is an orphan, the corresponding #ifdef is removed.
To keep the ability to enable debugging at compile time,
the call to printk(KERN_DEBUG ...) is replaced by a corresponding
call to dev_dbg(), which is configurable via CONFIG_DYNAMIC_DEBUG.

Signed-off-by: Phillip Raffeck <phillip.raffeck@fau.de>
Signed-off-by: Anton Würfel <anton.wuerfel@fau.de>
Cc: linux-kernel@i4.cs.fau.de
---
 drivers/tty/serial/8250/8250_pnp.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index ffa7354..ba3a1af 100644
--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -464,11 +464,11 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 	} else
 		return -ENODEV;
 
-#ifdef SERIAL_DEBUG_PNP
-	printk(KERN_DEBUG
-		"Setup PNP port: port %x, mem 0x%lx, irq %d, type %d\n",
-		       uart.port.iobase, uart.port.mapbase, uart.port.irq, uart.port.iotype);
-#endif
+	dev_dbg(&dev->dev,
+		 "Setup PNP port: port %x, mem 0x%lx, irq %d, type %d\n",
+		 uart.port.iobase, uart.port.mapbase,
+		 uart.port.irq, uart.port.iotype);
+
 	if (flags & CIR_PORT) {
 		uart.port.flags |= UPF_FIXED_PORT | UPF_FIXED_TYPE;
 		uart.port.type = PORT_8250_CIR;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 12/15] tty: serial: 8250: Correct conversion specifiers
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (10 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 11/15] tty: serial: 8250: Remove SERIAL_DEBUG_PNP macro Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 13/15] tty: serial: 8250: Fix indentation warnings Anton Wuerfel
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

This patch fixes compiler warnings about wrong conversion specifiers used
in a debug output in 8250_pnp.c. The precise warning is:

drivers/tty/serial/8250/8250_pnp.c: In function ‘serial_pnp_probe’:
include/linux/dynamic_debug.h:64:16: warning: format ‘%x’ expects argument
of [...]

include/linux/dynamic_debug.h:84:2: note: in expansion of macro
‘DEFINE_DYNAMIC_DEBUG_METADATA’

include/linux/device.h:1179:2: note: in expansion of macro
‘dynamic_dev_dbg’

drivers/tty/serial/8250/8250_pnp.c:467:2: note: in expansion of macro
‘dev_dbg’
  dev_dbg(&dev->dev,
  ^
include/linux/dynamic_debug.h:64:16: warning: format ‘%lx’ expects argument
of [...]

include/linux/dynamic_debug.h:84:2: note: in expansion of macro
‘DEFINE_DYNAMIC_DEBUG_METADATA’

include/linux/device.h:1179:2: note: in expansion of macro
‘dynamic_dev_dbg’

drivers/tty/serial/8250/8250_pnp.c:467:2: note: in expansion of macro
‘dev_dbg’
  dev_dbg(&dev->dev,
  ^

Those warnings never got triggered, because the command was nested
in an #ifdef, which is removed by a patch of this series.

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_pnp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index ba3a1af..9305591 100644
--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -465,8 +465,8 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 		return -ENODEV;
 
 	dev_dbg(&dev->dev,
-		 "Setup PNP port: port %x, mem 0x%lx, irq %d, type %d\n",
-		 uart.port.iobase, uart.port.mapbase,
+		 "Setup PNP port: port %lx, mem 0x%lx, irq %d, type %d\n",
+		 uart.port.iobase, (unsigned long)uart.port.mapbase,
 		 uart.port.irq, uart.port.iotype);
 
 	if (flags & CIR_PORT) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 13/15] tty: serial: 8250: Fix indentation warnings
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (11 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 12/15] tty: serial: 8250: Correct conversion specifiers Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 14/15] tty: serial: 8250: Add generic port init macro Anton Wuerfel
  2016-01-13 16:39 ` [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions Anton Wuerfel
  14 siblings, 0 replies; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

Checkpatch complains about incorrect indentation of switch/case statements.
This patch fixes the corresponding warnings. Additionally some indentation
is changed to match the correct format specified in the Linux Kernel
Coding Style.

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  | 20 ++++++++++----------
 drivers/tty/serial/8250/8250_pnp.c  |  4 ++--
 drivers/tty/serial/8250/8250_port.c |  6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 433afdd..1dd607f 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -841,17 +841,17 @@ static int pci_netmos_init(struct pci_dev *dev)
 		return 0;
 
 	switch (dev->device) { /* FALLTHROUGH on all */
-		case PCI_DEVICE_ID_NETMOS_9904:
-		case PCI_DEVICE_ID_NETMOS_9912:
-		case PCI_DEVICE_ID_NETMOS_9922:
-		case PCI_DEVICE_ID_NETMOS_9900:
-			num_serial = pci_netmos_9900_numports(dev);
-			break;
+	case PCI_DEVICE_ID_NETMOS_9904:
+	case PCI_DEVICE_ID_NETMOS_9912:
+	case PCI_DEVICE_ID_NETMOS_9922:
+	case PCI_DEVICE_ID_NETMOS_9900:
+		num_serial = pci_netmos_9900_numports(dev);
+		break;
 
-		default:
-			if (num_serial == 0) {
-				moan_device("unknown NetMos/Mostech device", dev);
-			}
+	default:
+		if (num_serial == 0) {
+			moan_device("unknown NetMos/Mostech device", dev);
+		}
 	}
 
 	if (num_serial == 0)
diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c
index 9305591..a11180d 100644
--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -427,8 +427,8 @@ static int check_resources(struct pnp_dev *dev)
 static int serial_pnp_guess_board(struct pnp_dev *dev)
 {
 	if (!(check_name(pnp_dev_name(dev)) ||
-		(dev->card && check_name(dev->card->name))))
-			return -ENODEV;
+	    (dev->card && check_name(dev->card->name))))
+		return -ENODEV;
 
 	if (check_resources(dev))
 		return 0;
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 343d050..da3b240 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -2235,9 +2235,9 @@ static void serial8250_set_divisor(struct uart_port *port, unsigned int baud,
 		serial_port_out(port, 0x2, quot_frac);
 }
 
-static unsigned int
-serial8250_get_baud_rate(struct uart_port *port, struct ktermios *termios,
-			 struct ktermios *old)
+static unsigned int serial8250_get_baud_rate(struct uart_port *port,
+					     struct ktermios *termios,
+					     struct ktermios *old)
 {
 	unsigned int tolerance = port->uartclk / 100;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 14/15] tty: serial: 8250: Add generic port init macro
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (12 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 13/15] tty: serial: 8250: Fix indentation warnings Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 17:22   ` Andy Shevchenko
  2016-01-13 16:39 ` [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions Anton Wuerfel
  14 siblings, 1 reply; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

This patch removes redundant 8250 port initialization macros and
replaces them by a single generic base-macro, which is specialized
as needed.

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.h               | 12 ++++++++
 drivers/tty/serial/8250/8250_accent.c        | 13 ++-------
 drivers/tty/serial/8250/8250_boca.c          | 41 ++++++++++++----------------
 drivers/tty/serial/8250/8250_exar_st16c554.c | 17 ++++--------
 drivers/tty/serial/8250/8250_fourport.c      | 28 ++++++++-----------
 5 files changed, 49 insertions(+), 62 deletions(-)

diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
index d54dcd8..4672ab4 100644
--- a/drivers/tty/serial/8250/8250.h
+++ b/drivers/tty/serial/8250/8250.h
@@ -92,6 +92,18 @@ struct serial8250_config {
 #define SERIAL8250_SHARE_IRQS 0
 #endif
 
+#define SERIAL8250_PORT_FLAGS(_base, _irq, _flags)		\
+	{							\
+		.iobase		= _base,			\
+		.irq		= _irq,				\
+		.uartclk	= 1843200,			\
+		.iotype		= UPIO_PORT,			\
+		.flags		= UPF_BOOT_AUTOCONF | (_flags),	\
+	}
+
+#define SERIAL8250_PORT(_base, _irq) SERIAL8250_PORT_FLAGS(_base, _irq, 0)
+
+
 static inline int serial_in(struct uart_8250_port *up, int offset)
 {
 	return up->port.serial_in(&up->port, offset);
diff --git a/drivers/tty/serial/8250/8250_accent.c b/drivers/tty/serial/8250/8250_accent.c
index 34b51c6..522aeae 100644
--- a/drivers/tty/serial/8250/8250_accent.c
+++ b/drivers/tty/serial/8250/8250_accent.c
@@ -10,18 +10,11 @@
 #include <linux/init.h>
 #include <linux/serial_8250.h>
 
-#define PORT(_base,_irq)				\
-	{						\
-		.iobase		= _base,		\
-		.irq		= _irq,			\
-		.uartclk	= 1843200,		\
-		.iotype		= UPIO_PORT,		\
-		.flags		= UPF_BOOT_AUTOCONF,	\
-	}
+#include "8250.h"
 
 static struct plat_serial8250_port accent_data[] = {
-	PORT(0x330, 4),
-	PORT(0x338, 4),
+	SERIAL8250_PORT(0x330, 4),
+	SERIAL8250_PORT(0x338, 4),
 	{ },
 };
 
diff --git a/drivers/tty/serial/8250/8250_boca.c b/drivers/tty/serial/8250/8250_boca.c
index d125dc1..a63b599 100644
--- a/drivers/tty/serial/8250/8250_boca.c
+++ b/drivers/tty/serial/8250/8250_boca.c
@@ -10,32 +10,25 @@
 #include <linux/init.h>
 #include <linux/serial_8250.h>
 
-#define PORT(_base,_irq)				\
-	{						\
-		.iobase		= _base,		\
-		.irq		= _irq,			\
-		.uartclk	= 1843200,		\
-		.iotype		= UPIO_PORT,		\
-		.flags		= UPF_BOOT_AUTOCONF,	\
-	}
+#include "8250.h"
 
 static struct plat_serial8250_port boca_data[] = {
-	PORT(0x100, 12),
-	PORT(0x108, 12),
-	PORT(0x110, 12),
-	PORT(0x118, 12),
-	PORT(0x120, 12),
-	PORT(0x128, 12),
-	PORT(0x130, 12),
-	PORT(0x138, 12),
-	PORT(0x140, 12),
-	PORT(0x148, 12),
-	PORT(0x150, 12),
-	PORT(0x158, 12),
-	PORT(0x160, 12),
-	PORT(0x168, 12),
-	PORT(0x170, 12),
-	PORT(0x178, 12),
+	SERIAL8250_PORT(0x100, 12),
+	SERIAL8250_PORT(0x108, 12),
+	SERIAL8250_PORT(0x110, 12),
+	SERIAL8250_PORT(0x118, 12),
+	SERIAL8250_PORT(0x120, 12),
+	SERIAL8250_PORT(0x128, 12),
+	SERIAL8250_PORT(0x130, 12),
+	SERIAL8250_PORT(0x138, 12),
+	SERIAL8250_PORT(0x140, 12),
+	SERIAL8250_PORT(0x148, 12),
+	SERIAL8250_PORT(0x150, 12),
+	SERIAL8250_PORT(0x158, 12),
+	SERIAL8250_PORT(0x160, 12),
+	SERIAL8250_PORT(0x168, 12),
+	SERIAL8250_PORT(0x170, 12),
+	SERIAL8250_PORT(0x178, 12),
 	{ },
 };
 
diff --git a/drivers/tty/serial/8250/8250_exar_st16c554.c b/drivers/tty/serial/8250/8250_exar_st16c554.c
index bf53aab..3a7cb82 100644
--- a/drivers/tty/serial/8250/8250_exar_st16c554.c
+++ b/drivers/tty/serial/8250/8250_exar_st16c554.c
@@ -13,20 +13,13 @@
 #include <linux/init.h>
 #include <linux/serial_8250.h>
 
-#define PORT(_base,_irq)				\
-	{						\
-		.iobase		= _base,		\
-		.irq		= _irq,			\
-		.uartclk	= 1843200,		\
-		.iotype		= UPIO_PORT,		\
-		.flags		= UPF_BOOT_AUTOCONF,	\
-	}
+#include "8250.h"
 
 static struct plat_serial8250_port exar_data[] = {
-	PORT(0x100, 5),
-	PORT(0x108, 5),
-	PORT(0x110, 5),
-	PORT(0x118, 5),
+	SERIAL8250_PORT(0x100, 5),
+	SERIAL8250_PORT(0x108, 5),
+	SERIAL8250_PORT(0x110, 5),
+	SERIAL8250_PORT(0x118, 5),
 	{ },
 };
 
diff --git a/drivers/tty/serial/8250/8250_fourport.c b/drivers/tty/serial/8250/8250_fourport.c
index be15826..4045180 100644
--- a/drivers/tty/serial/8250/8250_fourport.c
+++ b/drivers/tty/serial/8250/8250_fourport.c
@@ -10,24 +10,20 @@
 #include <linux/init.h>
 #include <linux/serial_8250.h>
 
-#define PORT(_base,_irq)						\
-	{								\
-		.iobase		= _base,				\
-		.irq		= _irq,					\
-		.uartclk	= 1843200,				\
-		.iotype		= UPIO_PORT,				\
-		.flags		= UPF_BOOT_AUTOCONF | UPF_FOURPORT,	\
-	}
+#include "8250.h"
+
+#define SERIAL8250_FOURPORT(_base, _irq) \
+	SERIAL8250_PORT_FLAGS(_base, _irq, UPF_FOURPORT)
 
 static struct plat_serial8250_port fourport_data[] = {
-	PORT(0x1a0, 9),
-	PORT(0x1a8, 9),
-	PORT(0x1b0, 9),
-	PORT(0x1b8, 9),
-	PORT(0x2a0, 5),
-	PORT(0x2a8, 5),
-	PORT(0x2b0, 5),
-	PORT(0x2b8, 5),
+	SERIAL8250_FOURPORT(0x1a0, 9),
+	SERIAL8250_FOURPORT(0x1a8, 9),
+	SERIAL8250_FOURPORT(0x1b0, 9),
+	SERIAL8250_FOURPORT(0x1b8, 9),
+	SERIAL8250_FOURPORT(0x2a0, 5),
+	SERIAL8250_FOURPORT(0x2a8, 5),
+	SERIAL8250_FOURPORT(0x2b0, 5),
+	SERIAL8250_FOURPORT(0x2b8, 5),
 	{ },
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions
  2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
                   ` (13 preceding siblings ...)
  2016-01-13 16:39 ` [PATCH v5 14/15] tty: serial: 8250: Add generic port init macro Anton Wuerfel
@ 2016-01-13 16:39 ` Anton Wuerfel
  2016-01-13 17:28   ` Andy Shevchenko
  14 siblings, 1 reply; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 16:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Andy Shevchenko, Qipeng Zha, Desmond Liu,
	Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck, Anton Wuerfel

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

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v5 04/15] tty: serial: 8250: Fix multiline comment style
  2016-01-13 16:39 ` [PATCH v5 04/15] tty: serial: 8250: Fix multiline comment style Anton Wuerfel
@ 2016-01-13 17:03   ` Andy Shevchenko
  0 siblings, 0 replies; 23+ messages in thread
From: Andy Shevchenko @ 2016-01-13 17:03 UTC (permalink / raw)
  To: Anton Wuerfel, Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Qipeng Zha, Desmond Liu, Wang Long,
	Matt Redfearn, Paul Burton, Ralf Baechle, Krzysztof Kozlowski,
	Peter Hung, Soeren Grunewald, Adam Lee, Maciej S. Szmigiero,
	Mans Rullgard, linux-kernel, linux-parisc, linux-kernel,
	Phillip Raffeck

On Wed, 2016-01-13 at 17:39 +0100, Anton Wuerfel wrote:
> Checkpatch outputs some warnings about incorrect comment style,
> which is fixed by this patch.
> 


> --- a/drivers/tty/serial/8250/8250_ingenic.c
> +++ b/drivers/tty/serial/8250/8250_ingenic.c
> @@ -152,14 +152,18 @@ static void ingenic_uart_serial_out(struct
> uart_port *p, int offset, int value)
>  		break;
>  
>  	case UART_IER:
> -		/* Enable receive timeout interrupt with the
> -		 * receive line status interrupt */
> +		/*
> +		 * Enable receive timeout interrupt with the
> +		 * receive line status interrupt

I'm pretty sure that at least one word could fit previous line.

Can you re-check your patches with sane editor setting for line
breaking (like 76 characters)?

> +		 */
>  		value |= (value & 0x4) << 2;
>  		break;
>  
>  	case UART_MCR:
> -		/* If we have enabled modem status IRQs we should
> enable modem
> -		 * mode. */
> +		/*
> +		 * If we have enabled modem status IRQs we should
> enable modem
> +		 * mode.

To check.

> +		 */
> 

> @@ -367,8 +367,10 @@ static const struct pnp_device_id
> pnp_dev_table[] = {
>  	{	"PNPCXXX",		UNKNOWN_DEV	},
>  	/* More unknown PnP modems */
>  	{	"PNPDXXX",		UNKNOWN_DEV	},
> -	/* Winbond CIR port, should not be probed. We should keep
> track
> -	   of it to prevent the legacy serial driver from probing it
> */
> +	/*
> +	 * Winbond CIR port, should not be probed. We should keep
> track
> +	 * of it to prevent the legacy serial driver from probing it

I would suggest to add dot at the end of sentences. Here and in the
rest of the places.


> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -250,9 +250,11 @@ static const struct serial8250_config
> uart_config[] = {
>  		.fcr		= UART_FCR_ENABLE_FIFO |
> UART_FCR_R_TRIG_10,
>  		.flags		= UART_CAP_FIFO |
> UART_CAP_AFE,
>  	},
> -/* tx_loadsz is set to 63-bytes instead of 64-bytes to implement
> -workaround of errata A-008006 which states that tx_loadsz should  be
> -configured less than Maximum supported fifo bytes */
> +	/*
> +	 * tx_loadsz is set to 63-bytes instead of 64-bytes to
> implement
> +	 * workaround of errata A-008006 which states that tx_loadsz
> should be
> +	 * configured less than Maximum supported fifo bytes

Ditto.

> --- a/drivers/tty/serial/8250/serial_cs.c
> +++ b/drivers/tty/serial/8250/serial_cs.c
> @@ -441,16 +441,20 @@ static int simple_config(struct pcmcia_device
> *link)
>  	struct serial_info *info = link->priv;
>  	int i = -ENODEV, try;
>  
> -	/* First pass: look for a config entry that looks normal.
> -	 * Two tries: without IO aliases, then with aliases */
> +	/*
> +	 * First pass: look for a config entry that looks normal.
> +	 * Two tries: without IO aliases, then with aliases

Ditto.

> @@ -480,8 +484,10 @@ static int multi_config_check(struct
> pcmcia_device *p_dev, void *priv_data)
>  	if (p_dev->resource[1]->end)
>  		return -EINVAL;
>  
> -	/* The quad port cards have bad CIS's, so just look for a
> -	   window larger than 8 ports and assume it will be right */
> +	/*
> +	 * The quad port cards have bad CIS's, so just look for a
> +	 * window larger than 8 ports and assume it will be right

Ditto.

> -	/* Another check for dual-serial cards: look for either
> serial or
> -	   multifunction cards that ask for appropriate IO port
> ranges */
> +	/*
> +	 * Another check for dual-serial cards: look for either
> serial or
> +	 * multifunction cards that ask for appropriate IO port
> ranges

Ditto.

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v5 05/15] tty: serial: 8250: Remove else after return
  2016-01-13 16:39 ` [PATCH v5 05/15] tty: serial: 8250: Remove else after return Anton Wuerfel
@ 2016-01-13 17:05   ` Andy Shevchenko
  0 siblings, 0 replies; 23+ messages in thread
From: Andy Shevchenko @ 2016-01-13 17:05 UTC (permalink / raw)
  To: Anton Wuerfel, Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Qipeng Zha, Desmond Liu, Wang Long,
	Matt Redfearn, Paul Burton, Ralf Baechle, Krzysztof Kozlowski,
	Peter Hung, Soeren Grunewald, Adam Lee, Maciej S. Szmigiero,
	Mans Rullgard, linux-kernel, linux-parisc, linux-kernel,
	Phillip Raffeck

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@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v5 09/15] tty: serial: 8250: Fix multi-line strings
  2016-01-13 16:39 ` [PATCH v5 09/15] tty: serial: 8250: Fix multi-line strings Anton Wuerfel
@ 2016-01-13 17:08   ` Andy Shevchenko
  0 siblings, 0 replies; 23+ messages in thread
From: Andy Shevchenko @ 2016-01-13 17:08 UTC (permalink / raw)
  To: Anton Wuerfel, Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Qipeng Zha, Desmond Liu, Wang Long,
	Matt Redfearn, Paul Burton, Ralf Baechle, Krzysztof Kozlowski,
	Peter Hung, Soeren Grunewald, Adam Lee, Maciej S. Szmigiero,
	Mans Rullgard, linux-kernel, linux-parisc, linux-kernel,
	Phillip Raffeck

On Wed, 2016-01-13 at 17:39 +0100, Anton Wuerfel wrote:
> Merged user-visible multi-line strings into a single line according
> to the
> Linux Kernel Coding Style, which allows user-visible strings to
> exceed the
> maximum line length of 80 characters. The main reason for this is to
> facilitate grepping for these strings.
> However, some strings were ignored in this patch, because the use of
> format specifiers breaks the ability to grep anyway.
> 

> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -1173,8 +1173,7 @@ MODULE_LICENSE("GPL");
>  MODULE_DESCRIPTION("Generic 8250/16x50 serial driver");
>  
>  module_param(share_irqs, uint, 0644);
> -MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50
> devices"
> -	" (unsafe)");
> +MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50
> devices (unsafe)");

This one looks nice in one line.

> --- a/drivers/tty/serial/8250/serial_cs.c
> +++ b/drivers/tty/serial/8250/serial_cs.c
> @@ -533,8 +533,7 @@ static int multi_config(struct pcmcia_device
> *link)
>  		info->multi = 2;
>  		if (pcmcia_loop_config(link,
> multi_config_check_notpicky,
>  				       &base2)) {
> -			dev_warn(&link->dev, "no usable port range "
> -			       "found, giving up\n");
> +			dev_warn(&link->dev, "no usable port range
> found, giving up\n");

But here I would comment as in patch 5, i.e. move literal to next line
it it doesn't fit on the dev_warn() line.

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v5 14/15] tty: serial: 8250: Add generic port init macro
  2016-01-13 16:39 ` [PATCH v5 14/15] tty: serial: 8250: Add generic port init macro Anton Wuerfel
@ 2016-01-13 17:22   ` Andy Shevchenko
  2016-01-13 17:25     ` Anton Wuerfel
  0 siblings, 1 reply; 23+ messages in thread
From: Andy Shevchenko @ 2016-01-13 17:22 UTC (permalink / raw)
  To: Anton Wuerfel, Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Qipeng Zha, Desmond Liu, Wang Long,
	Matt Redfearn, Paul Burton, Ralf Baechle, Krzysztof Kozlowski,
	Peter Hung, Soeren Grunewald, Adam Lee, Maciej S. Szmigiero,
	Mans Rullgard, linux-kernel, linux-parisc, linux-kernel,
	Phillip Raffeck

On Wed, 2016-01-13 at 17:39 +0100, Anton Wuerfel wrote:
> This patch removes redundant 8250 port initialization macros and
> replaces them by a single generic base-macro, which is specialized
> as needed.

Perhaps you forgot.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> 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

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v5 14/15] tty: serial: 8250: Add generic port init macro
  2016-01-13 17:22   ` Andy Shevchenko
@ 2016-01-13 17:25     ` Anton Wuerfel
  2016-01-13 17:30       ` Andy Shevchenko
  0 siblings, 1 reply; 23+ messages in thread
From: Anton Wuerfel @ 2016-01-13 17:25 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Anton Wuerfel, Greg Kroah-Hartman, Jiri Slaby,
	James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Qipeng Zha, Desmond Liu, Wang Long,
	Matt Redfearn, Paul Burton, Ralf Baechle, Krzysztof Kozlowski,
	Peter Hung, Soeren Grunewald, Adam Lee, Maciej S. Szmigiero,
	Mans Rullgard, linux-kernel, linux-parisc, linux-kernel,
	Phillip Raffeck

> On Wed, 2016-01-13 at 17:39 +0100, Anton Wuerfel wrote:
>> This patch removes redundant 8250 port initialization macros and
>> replaces them by a single generic base-macro, which is specialized
>> as needed.
>
> Perhaps you forgot.
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Sorry, we did not even know that this tag existed. We will add this in our
next patch series.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions
  2016-01-13 16:39 ` [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions Anton Wuerfel
@ 2016-01-13 17:28   ` Andy Shevchenko
  0 siblings, 0 replies; 23+ messages in thread
From: Andy Shevchenko @ 2016-01-13 17:28 UTC (permalink / raw)
  To: Anton Wuerfel, Greg Kroah-Hartman
  Cc: Jiri Slaby, James E.J. Bottomley, Helge Deller, Peter Hurley,
	Heikki Krogerus, Qipeng Zha, Desmond Liu, Wang Long,
	Matt Redfearn, Paul Burton, Ralf Baechle, Krzysztof Kozlowski,
	Peter Hung, Soeren Grunewald, Adam Lee, Maciej S. Szmigiero,
	Mans Rullgard, linux-kernel, linux-parisc, linux-kernel,
	Phillip Raffeck

On Wed, 2016-01-13 at 17:39 +0100, Anton Wuerfel wrote:
> 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.
> 

+ Suggested-by:

And I would recommend to put this patch before #13 in the series.

> 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;
> +	}

Yep!
However, you forgot to fix switch-case as well.

>  
>  	return num_serial;
>  }

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v5 14/15] tty: serial: 8250: Add generic port init macro
  2016-01-13 17:25     ` Anton Wuerfel
@ 2016-01-13 17:30       ` Andy Shevchenko
  0 siblings, 0 replies; 23+ messages in thread
From: Andy Shevchenko @ 2016-01-13 17:30 UTC (permalink / raw)
  To: Anton Wuerfel
  Cc: Greg Kroah-Hartman, Jiri Slaby, James E.J. Bottomley,
	Helge Deller, Peter Hurley, Heikki Krogerus, Qipeng Zha,
	Desmond Liu, Wang Long, Matt Redfearn, Paul Burton, Ralf Baechle,
	Krzysztof Kozlowski, Peter Hung, Soeren Grunewald, Adam Lee,
	Maciej S. Szmigiero, Mans Rullgard, linux-kernel, linux-parisc,
	linux-kernel, Phillip Raffeck

On Wed, 2016-01-13 at 18:25 +0100, Anton Wuerfel wrote:
> > On Wed, 2016-01-13 at 17:39 +0100, Anton Wuerfel wrote:
> > > This patch removes redundant 8250 port initialization macros and
> > > replaces them by a single generic base-macro, which is
> > > specialized
> > > as needed.
> > 
> > Perhaps you forgot.
> > Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Sorry, we did not even know that this tag existed. We will add this
> in our
> next patch series.
> 

Also, please thin out the Cc list, I would recommend remove just
ordinary commiters (with maybe few exceptions) and leave maintainers. 
Moreover some addresses are bounced.

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2016-01-13 17:30 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13 16:39 [PATCH v5 00/15] tty: serial: 8250: Fix checkpatch warnings Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 01/15] tty: serial: 8250: Fix whitespace errors Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 02/15] tty: serial: 8250: Replace spaces with tabs Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 03/15] tty: serial: 8250: Fix braces after struct Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 04/15] tty: serial: 8250: Fix multiline comment style Anton Wuerfel
2016-01-13 17:03   ` Andy Shevchenko
2016-01-13 16:39 ` [PATCH v5 05/15] tty: serial: 8250: Remove else after return Anton Wuerfel
2016-01-13 17:05   ` Andy Shevchenko
2016-01-13 16:39 ` [PATCH v5 06/15] tty: serial: 8250: Move EXPORT_SYMBOL to function Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 07/15] tty: serial: 8250: Fix line continuation warning Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 08/15] tty: serial: 8250: Add parentheses to macro Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 09/15] tty: serial: 8250: Fix multi-line strings Anton Wuerfel
2016-01-13 17:08   ` Andy Shevchenko
2016-01-13 16:39 ` [PATCH v5 10/15] tty: serial: 8250: Suitably replace printk Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 11/15] tty: serial: 8250: Remove SERIAL_DEBUG_PNP macro Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 12/15] tty: serial: 8250: Correct conversion specifiers Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 13/15] tty: serial: 8250: Fix indentation warnings Anton Wuerfel
2016-01-13 16:39 ` [PATCH v5 14/15] tty: serial: 8250: Add generic port init macro Anton Wuerfel
2016-01-13 17:22   ` Andy Shevchenko
2016-01-13 17:25     ` Anton Wuerfel
2016-01-13 17:30       ` Andy Shevchenko
2016-01-13 16:39 ` [PATCH v5 15/15] tty: serial: 8250: Merge duplicate conditions Anton Wuerfel
2016-01-13 17:28   ` Andy Shevchenko

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