Skip to contentSkip to conversation

staging: dgnc: dgnc_tty.c: Avoid '(' at the end of line

PATCH Superseded Nishad Kamdar 2 participants 3 messages Jul 22, 2018 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: dgnc: dgnc_tty.c: Avoid '(' at the end of line

Bring the first argument to the previous line and
align the other lines to match open parenthesis.
Issue found by checkpatch.

---
 drivers/staging/dgnc/dgnc_tty.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/dgnc/dgnc_tty.c +3 -4
index 9f9b9a5b4b27..2135bedc09db 100644
@@ -883,10 +883,9 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
 	 * touched safely, the close routine will signal the
 	 * ch_flags_wait to wake us back up.
 	 */
-	rc = wait_event_interruptible(
-				ch->ch_flags_wait,
-				(((ch->ch_tun.un_flags |
-				ch->ch_pun.un_flags) & UN_CLOSING) == 0));
+	rc = wait_event_interruptible(ch->ch_flags_wait,
+				      (((ch->ch_tun.un_flags |
+				      ch->ch_pun.un_flags) & UN_CLOSING) == 0));
 	/* If ret is non-zero, user ctrl-c'ed us */
 	if (rc)
 		return -EINTR;
Signature · 1 line
2.17.1
#1 lore raw
Quoted 2 lines · Nishad Kamdar

Bring the first argument to the previous line and
align the other lines to match open parenthesis.

[]

drivers/staging/dgnc/dgnc_tty.c

Quoted 1 line
drivers/staging/dgnc/dgnc_tty.c +0 -0

[]

drivers/staging/dgnc/dgnc_tty.c static int dgnc_tty_open(struct tty_struct *tty, struct file *file) · line 888

Quoted 11 lines
drivers/staging/dgnc/dgnc_tty.c +3 -4
@@ -883,10 +883,9 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
 	 * touched safely, the close routine will signal the
 	 * ch_flags_wait to wake us back up.
 	 */
-	rc = wait_event_interruptible(
-				ch->ch_flags_wait,
-				(((ch->ch_tun.un_flags |
-				ch->ch_pun.un_flags) & UN_CLOSING) == 0));
+	rc = wait_event_interruptible(ch->ch_flags_wait,
+				      (((ch->ch_tun.un_flags |
+				      ch->ch_pun.un_flags) & UN_CLOSING) == 0));

This would be better without the superfluous () and perhaps use !

	rc = wait_event_interruptible(ch->ch_flags_wait,
				      !((ch->ch_tun.un_flags |
					 ch->ch_pun.un_flags) & UN_CLOSING));
#2 lore raw
Quoted 21 lines · Joe Perches
Quoted 2 lines · Nishad Kamdar

Bring the first argument to the previous line and
align the other lines to match open parenthesis.

[]

drivers/staging/dgnc/dgnc_tty.c

Quoted 1 line
drivers/staging/dgnc/dgnc_tty.c +0 -0

[]

drivers/staging/dgnc/dgnc_tty.c static int dgnc_tty_open(struct tty_struct *tty, struct file *file) · line 888

Quoted 11 lines
drivers/staging/dgnc/dgnc_tty.c +3 -4
@@ -883,10 +883,9 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
 	 * touched safely, the close routine will signal the
 	 * ch_flags_wait to wake us back up.
 	 */
-	rc = wait_event_interruptible(
-				ch->ch_flags_wait,
-				(((ch->ch_tun.un_flags |
-				ch->ch_pun.un_flags) & UN_CLOSING) == 0));
+	rc = wait_event_interruptible(ch->ch_flags_wait,
+				      (((ch->ch_tun.un_flags |
+				      ch->ch_pun.un_flags) & UN_CLOSING) == 0));

This would be better without the superfluous () and perhaps use !

Quoted 5 lines
	rc = wait_event_interruptible(ch->ch_flags_wait,
				      !((ch->ch_tun.un_flags |
					 ch->ch_pun.un_flags) & UN_CLOSING));

Ok, I will revise the patch.
Thanks for the review.

regards,
nishad kamdar