Skip to contentSkip to conversation

TTY/JSM coding style fixes

PATCH In review Gimcuan Hui 2 participants 7 messages Nov 5, 2017 – Nov 6, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover TTY/JSM coding style fixes

This patch set fixes several warnings and errors reported by checkpatch.pl.

Gimcuan Hui (5):
tty: serial: jsm: change the type of local variable
tty: serial: jsm: add blank line after declarations
tty: serial: jsm: delete space between function name and '('
tty: serial: jsm: fix coding style
tty: serial: jsm: add space before the open parenthesis '('

 drivers/tty/serial/jsm/jsm_tty.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/5 tty: serial: jsm: change the type of local variable

The return type of jsm_get_mstat was int, and the local var result was for the return should be int, make the change.

This patch fixes the checkpatch.pl warning:
Prefer 'unsigned int' to bare use of 'unsigned'.

---
 drivers/tty/serial/jsm/jsm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/jsm/jsm_tty.c +1 -1
index e69227cc3827..729d2a083a74 100644
@@ -36,7 +36,7 @@ static void jsm_carrier(struct jsm_channel *ch);
 static inline int jsm_get_mstat(struct jsm_channel *ch)
 {
 	unsigned char mstat;
-	unsigned result;
+	int result;
 
 	jsm_dbg(IOCTL, &ch->ch_bd->pci_dev, "start\n");
 
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/5 tty: serial: jsm: add blank line after declarations

In reply to Gimcuan Hui

This patch fixes checkpatch.pl warning:

Missing a blank line after declarations.

---
 drivers/tty/serial/jsm/jsm_tty.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/jsm/jsm_tty.c +1 -0
index 729d2a083a74..ed58dfc3d40e 100644
@@ -124,6 +124,7 @@ static void jsm_tty_set_mctrl(struct uart_port *port, unsigned int mctrl)
 static void jsm_tty_write(struct uart_port *port)
 {
 	struct jsm_channel *channel;
+
 	channel = container_of(port, struct jsm_channel, uart_port);
 	channel->ch_bd->bd_ops->copy_data_from_queue_to_uart(channel);
 }
Signature · 1 line
2.11.0
#3 lore raw

PATCH 3/5 tty: serial: jsm: delete space between function name and '('

In reply to Gimcuan Hui

This patch fixes checkpatch.pl warning:

space prohibited between function name and open parenthesis '('.

---
 drivers/tty/serial/jsm/jsm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/jsm/jsm_tty.c +1 -1
index ed58dfc3d40e..53c3f53da241 100644
@@ -474,7 +474,7 @@ int jsm_uart_port_init(struct jsm_board *brd)
 		} else
 			set_bit(line, linemap);
 		brd->channels[i]->uart_port.line = line;
-		rc = uart_add_one_port (&jsm_uart_driver, &brd->channels[i]->uart_port);
+		rc = uart_add_one_port(&jsm_uart_driver, &brd->channels[i]->uart_port);
 		if (rc) {
 			printk(KERN_INFO "jsm: Port %d failed. Aborting...\n", i);
 			return rc;
Signature · 1 line
2.11.0
#4 lore raw

PATCH 4/5 tty: serial: jsm: fix coding style

In reply to Gimcuan Hui

This patch fixes the checkpatch.pl complain:

ERROR: else should follow close brace '}'.

---
 drivers/tty/serial/jsm/jsm_tty.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/jsm/jsm_tty.c +1 -2
index 53c3f53da241..3853bfa5aa46 100644
@@ -478,8 +478,7 @@ int jsm_uart_port_init(struct jsm_board *brd)
 		if (rc) {
 			printk(KERN_INFO "jsm: Port %d failed. Aborting...\n", i);
 			return rc;
-		}
-		else
+		} else
 			printk(KERN_INFO "jsm: Port %d added\n", i);
 	}
 
Signature · 1 line
2.11.0
#5 lore raw

PATCH 5/5 tty: serial: jsm: add space before the open parenthesis '('

In reply to Gimcuan Hui

This patch fixes the checkpatch.pl complains:

space required before the open parenthesis '('.

---
 drivers/tty/serial/jsm/jsm_tty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/jsm/jsm_tty.c +2 -2
index 3853bfa5aa46..cbbadafe61fb 100644
@@ -541,7 +541,7 @@ void jsm_input(struct jsm_channel *ch)
 	tp = port->tty;
 
 	bd = ch->ch_bd;
-	if(!bd)
+	if (!bd)
 		return;
 
 	spin_lock_irqsave(&ch->ch_lock, lock_flags);
@@ -781,7 +781,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch)
 	if (qleft < 256) {
 		/* HWFLOW */
 		if (ch->ch_c_cflag & CRTSCTS) {
-			if(!(ch->ch_flags & CH_RECEIVER_OFF)) {
+			if (!(ch->ch_flags & CH_RECEIVER_OFF)) {
 				bd_ops->disable_receiver(ch);
 				ch->ch_flags |= (CH_RECEIVER_OFF);
 				jsm_dbg(READ, &ch->ch_bd->pci_dev,
Signature · 1 line
2.11.0
Acked-by on the v1 series
#6 lore raw
In reply to Gimcuan Hui
Quoted 10 lines · Gimcuan Hui

This patch set fixes several warnings and errors reported by checkpatch.pl.

Gimcuan Hui (5):
tty: serial: jsm: change the type of local variable
tty: serial: jsm: add blank line after declarations
tty: serial: jsm: delete space between function name and '('
tty: serial: jsm: fix coding style
tty: serial: jsm: add space before the open parenthesis '('

Quoted 3 lines
 drivers/tty/serial/jsm/jsm_tty.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Thanks for the fixes Gimcuan!

For the entire series: