Skip to contentSkip to conversation

tty: moxa: Fix coding style issues

PATCH Superseded Antoine Robertson 2 participants 2 messages Jan 19, 2019 TTY layer and serial drivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: moxa: Fix coding style issues

Fix coding style issues

---
 drivers/tty/moxa.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
drivers/tty/moxa.c +8 -11
index 3a1a5e0ee93f..8641f8ecf1d6 100644
@@ -42,7 +42,7 @@
 #include <linux/slab.h>
 #include <linux/ratelimit.h>
 
-#include <asm/io.h>
+#include <linux/io.h>
 #include <linux/uaccess.h>
 
 #include "moxa.h"
@@ -74,8 +74,7 @@ enum {
 	MOXA_BOARD_CP204J,
 };
 
-static char *moxa_brdname[] =
-{
+static char *moxa_brdname[] = {
 	"C218 Turbo PCI series",
 	"C218 Turbo ISA series",
 	"C320 Turbo PCI series",
@@ -1159,9 +1158,8 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
 	int port;
 
 	port = tty->index;
-	if (port == MAX_PORTS) {
+	if (port == MAX_PORTS)
 		return capable(CAP_SYS_ADMIN) ? 0 : -EPERM;
-	}
 	if (mutex_lock_interruptible(&moxa_openlock))
 		return -ERESTARTSYS;
 	brd = &moxa_boards[port / MAX_PORTS_PER_BOARD];
@@ -1357,8 +1355,7 @@ static void moxa_new_dcdstate(struct moxa_port *p, u8 dcd)
         	spin_unlock_irqrestore(&p->port.lock, flags);
 		if (!dcd)
 			tty_port_tty_hangup(&p->port, true);
-	}
-	else
+	} else
 		spin_unlock_irqrestore(&p->port.lock, flags);
 }
 
@@ -1625,10 +1622,10 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode)
  *      Syntax:
  *      void MoxaPortFlushData(int port, int mode);
  *           int port           : port number (0 - 127)
- *           int mode    
- *                      0       : flush the Rx buffer 
- *                      1       : flush the Tx buffer 
- *                      2       : flush the Rx and Tx buffer 
+ *           int mode
+ *                      0       : flush the Rx buffer
+ *                      1       : flush the Tx buffer
+ *                      2       : flush the Rx and Tx buffer
  *
  *
  *      Function 20:    Write data.
Signature · 1 line
2.17.1
#1 lore raw
Quoted 1 line · Antoine Robertson

Fix coding style issues

[]

drivers/tty/moxa.c

Quoted 1 line
drivers/tty/moxa.c +0 -0

[]

drivers/tty/moxa.c enum { · line 77

Quoted 7 lines
drivers/tty/moxa.c +1 -2
@@ -74,8 +74,7 @@ enum {
 	MOXA_BOARD_CP204J,
 };
 
-static char *moxa_brdname[] =
-{
+static char *moxa_brdname[] = {

If you're going to fix this, might as well make it static const char *

drivers/tty/moxa.c enum { · line 80

Quoted 3 lines
drivers/tty/moxa.c +0 -0
 	"C218 Turbo PCI series",
 	"C218 Turbo ISA series",
 	"C320 Turbo PCI series",

[]

drivers/tty/moxa.c static void moxa_new_dcdstate(struct moxa_port *p, u8 dcd) · line 1358

Quoted 7 lines
drivers/tty/moxa.c +1 -2
@@ -1357,8 +1355,7 @@ static void moxa_new_dcdstate(struct moxa_port *p, u8 dcd)
         	spin_unlock_irqrestore(&p->port.lock, flags);
 		if (!dcd)
 			tty_port_tty_hangup(&p->port, true);
-	}
-	else
+	} else

and use } else {

Quoted 2 lines
drivers/tty/moxa.c +0 -0
 		spin_unlock_irqrestore(&p->port.lock, flags);
 }