Skip to contentSkip to conversation

mxser: use semi-colons instead of commas

PATCH In review Dan Carpenter 3 participants 3 messages Aug 25, 2021

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

PATCH 1/1 mxser: use semi-colons instead of commas

This code works, but it's cleaner to use semi-colons at the end of a statement instead of a comma.

---
 drivers/tty/mxser.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/tty/mxser.c +6 -6
index 335e4e50d679..1216f3985e18 100644
@@ -1039,12 +1039,12 @@ static int mxser_get_serial_info(struct tty_struct *tty,
 	if (closing_wait != ASYNC_CLOSING_WAIT_NONE)
 		closing_wait = jiffies_to_msecs(closing_wait) / 10;
 
-	ss->type = info->type,
-	ss->line = tty->index,
-	ss->port = info->ioaddr,
-	ss->irq = info->board->irq,
-	ss->flags = info->port.flags,
-	ss->baud_base = MXSER_BAUD_BASE,
+	ss->type = info->type;
+	ss->line = tty->index;
+	ss->port = info->ioaddr;
+	ss->irq = info->board->irq;
+	ss->flags = info->port.flags;
+	ss->baud_base = MXSER_BAUD_BASE;
 	ss->close_delay = close_delay;
 	ss->closing_wait = closing_wait;
 	ss->custom_divisor = MXSER_CUSTOM_DIVISOR,
Signature · 1 line
2.20.1
#1 lore raw
Quoted 2 lines · Dan Carpenter

This code works, but it's cleaner to use semi-colons at the end of a statement instead of a comma.

There are still multiple dozens of this type of comma use in the kernel.

Julia Lawall created a cocci script to convert the commas to semicolons that worked pretty well.

https://lore.kernel.org/lkml/alpine.DEB.2.22.394.2008201856110.2524@hadrien/

drivers/tty/mxser.c

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

[]

Quoted 20 lines
drivers/tty/mxser.c +0 -0
@@ -1039,12 +1039,12 @@ static int mxser_get_serial_info(struct tty_struct *tty,
  	if (closing_wait != ASYNC_CLOSING_WAIT_NONE)
  		closing_wait = jiffies_to_msecs(closing_wait) / 10;

drivers/tty/mxser.c +6 -6
-	ss->type = info->type,
-	ss->line = tty->index,
-	ss->port = info->ioaddr,
-	ss->irq = info->board->irq,
-	ss->flags = info->port.flags,
-	ss->baud_base = MXSER_BAUD_BASE,
+	ss->type = info->type;
+	ss->line = tty->index;
+	ss->port = info->ioaddr;
+	ss->irq = info->board->irq;
+	ss->flags = info->port.flags;
+	ss->baud_base = MXSER_BAUD_BASE;

  ss->close_delay = close_delay; ss->closing_wait = closing_wait; ss->custom_divisor = MXSER_CUSTOM_DIVISOR,

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 4 lines · Dan Carpenter

This code works, but it's cleaner to use semi-colons at the end of a statement instead of a comma.

Quoted 28 lines
---
  drivers/tty/mxser.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
drivers/tty/mxser.c +6 -6
index 335e4e50d679..1216f3985e18 100644
@@ -1039,12 +1039,12 @@ static int mxser_get_serial_info(struct tty_struct *tty,
  	if (closing_wait != ASYNC_CLOSING_WAIT_NONE)
  		closing_wait = jiffies_to_msecs(closing_wait) / 10;
 
-	ss->type = info->type,
-	ss->line = tty->index,
-	ss->port = info->ioaddr,
-	ss->irq = info->board->irq,
-	ss->flags = info->port.flags,
-	ss->baud_base = MXSER_BAUD_BASE,
+	ss->type = info->type;
+	ss->line = tty->index;
+	ss->port = info->ioaddr;
+	ss->irq = info->board->irq;
+	ss->flags = info->port.flags;
+	ss->baud_base = MXSER_BAUD_BASE;
  	ss->close_delay = close_delay;
  	ss->closing_wait = closing_wait;
  	ss->custom_divisor = MXSER_CUSTOM_DIVISOR,
Signature · 2 lines
js
suse labs