Skip to contentSkip to conversation

tty: moxa: use semi-colons instead of commas

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

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

PATCH 1/1 tty: moxa: use semi-colons instead of commas

This code works but it's cleaner to use a semi-colon to end a statement instead of a comma.

---
 drivers/tty/moxa.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/moxa.c +4 -4
index 776f78de0f82..bf17e90858b8 100644
@@ -2034,10 +2034,10 @@ static int moxa_get_serial_info(struct tty_struct *tty,
 	if (!info)
 		return -ENODEV;
 	mutex_lock(&info->port.mutex);
-	ss->type = info->type,
-	ss->line = info->port.tty->index,
-	ss->flags = info->port.flags,
-	ss->baud_base = 921600,
+	ss->type = info->type;
+	ss->line = info->port.tty->index;
+	ss->flags = info->port.flags;
+	ss->baud_base = 921600;
 	ss->close_delay = jiffies_to_msecs(info->port.close_delay) / 10;
 	mutex_unlock(&info->port.mutex);
 	return 0;
Signature · 1 line
2.20.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

This code works but it's cleaner to use a semi-colon to end a statement instead of a comma.

I just wonder why:
tty: moxa:
vs
mxser:
with no "tty: "
...

Quoted 24 lines
---
  drivers/tty/moxa.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/moxa.c +4 -4
index 776f78de0f82..bf17e90858b8 100644
@@ -2034,10 +2034,10 @@ static int moxa_get_serial_info(struct tty_struct *tty,
  	if (!info)
  		return -ENODEV;
  	mutex_lock(&info->port.mutex);
-	ss->type = info->type,
-	ss->line = info->port.tty->index,
-	ss->flags = info->port.flags,
-	ss->baud_base = 921600,
+	ss->type = info->type;
+	ss->line = info->port.tty->index;
+	ss->flags = info->port.flags;
+	ss->baud_base = 921600;
  	ss->close_delay = jiffies_to_msecs(info->port.close_delay) / 10;
  	mutex_unlock(&info->port.mutex);
  	return 0;
Signature · 2 lines
js
suse labs
#2 lore raw
Quoted 6 lines · Jiri Slaby
Quoted 4 lines · Dan Carpenter

This code works but it's cleaner to use a semi-colon to end a statement instead of a comma.

Quoted 8 lines

I just wonder why:
tty: moxa:
vs
mxser:
with no "tty: "
...

Now I'm confused. There is a different mxser driver, but this is modifying moxa? I just copied from git log --oneline drivers/tty/moxa.c.

regards,
dan carpenter

Quoted 30 lines
Quoted 25 lines
---
  drivers/tty/moxa.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/moxa.c +4 -4
index 776f78de0f82..bf17e90858b8 100644
@@ -2034,10 +2034,10 @@ static int moxa_get_serial_info(struct tty_struct *tty,
  	if (!info)
  		return -ENODEV;
  	mutex_lock(&info->port.mutex);
-	ss->type = info->type,
-	ss->line = info->port.tty->index,
-	ss->flags = info->port.flags,
-	ss->baud_base = 921600,
+	ss->type = info->type;
+	ss->line = info->port.tty->index;
+	ss->flags = info->port.flags;
+	ss->baud_base = 921600;
  	ss->close_delay = jiffies_to_msecs(info->port.close_delay) / 10;
  	mutex_unlock(&info->port.mutex);
  	return 0;
Signature · 2 lines
js
suse labs