Skip to contentSkip to conversation

staging: fwserial: Fix alignment of function parameters

PATCH Superseded Prakash Dubey 3 participants 5 messages Feb 18, 2021 – Feb 19, 2021 1 message not in the archive Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: fwserial: Fix alignment of function parameters

This patch fixes the following checkpatch.pl check:

CHECK: Alignment should match open parenthesis

---
 drivers/staging/fwserial/fwserial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fwserial/fwserial.c +2 -2
index c368082aae1a..a92741b8b6c6 100644
@@ -1318,8 +1318,8 @@ static int fwtty_break_ctl(struct tty_struct *tty, int state)
 	if (state == -1) {
 		set_bit(STOP_TX, &port->flags);
 		ret = wait_event_interruptible_timeout(port->wait_tx,
-					       !test_bit(IN_TX, &port->flags),
-					       10);
+							!test_bit(IN_TX, &port->flags),
+							10);
 		if (ret == 0 || ret == -ERESTARTSYS) {
 			clear_bit(STOP_TX, &port->flags);
 			fwtty_restart_tx(port);
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 14 lines · Prakash Dubey

This patch fixes the following checkpatch.pl check:

CHECK: Alignment should match open parenthesis

---
 drivers/staging/fwserial/fwserial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/fwserial/fwserial.c +0 -0
index c368082aae1a..a92741b8b6c6 100644

drivers/staging/fwserial/fwserial.c static int fwtty_break_ctl(struct tty_struct *tty, int state) · line 1322

Quoted 7 lines
drivers/staging/fwserial/fwserial.c +2 -2
@@ -1318,8 +1318,8 @@ static int fwtty_break_ctl(struct tty_struct *tty, int state)
 	if (state == -1) {
 		set_bit(STOP_TX, &port->flags);
 		ret = wait_event_interruptible_timeout(port->wait_tx,
-					       !test_bit(IN_TX, &port->flags),
-					       10);
+							!test_bit(IN_TX, &port->flags),
+							10);

Shouldn't you make this line up with the ( above? This indents it a bit further :(

thanks,

greg k-h

maintainer
#3 lore raw
In reply to a message not in the archive
Quoted 4 lines · On Fri, Feb 19, 2021 at 03:25:38PM +0530, 17UCS047_Prakash Dubey wrote:

I was unable to align it right below the opening parenthesis, just by using tabs. And when I did that with spaces, the checkpatch yelled at me for using spaces. Any suggestions how to do this without using spaces? I am using vim, I will try to find a workaround meanwhile.

I have no context here for what you are asking about at all, sorry.

greg k-h

#4 lore raw
Quoted 6 lines · Greg KH
Quoted 4 lines · On Fri, Feb 19, 2021 at 03:25:38PM +0530, 17UCS047_Prakash Dubey wrote:

I was unable to align it right below the opening parenthesis, just by using tabs. And when I did that with spaces, the checkpatch yelled at me for using spaces. Any suggestions how to do this without using spaces? I am using vim, I will try to find a workaround meanwhile.

Your comment hasn't made it to the list yet. Sometimes there is a delay or maybe it was blocked for some reason (html email?).

You are allowed to use spaces but you can't have 8 consecutive spaces and spaces are not allowed before a tab character. The way to align it is:

		ret = wait_event_interruptible_timeout(port->wait_tx,
						       !test_bit(IN_TX, &port->flags),
						       10);

[tab x6][space x7]!test_bit(IN_TX, &port->flags)

regards,
dan carpenter

#5 lore raw
Quoted 15 lines · Dan Carpenter
Quoted 6 lines · Greg KH
Quoted 4 lines · On Fri, Feb 19, 2021 at 03:25:38PM +0530, 17UCS047_Prakash Dubey wrote:

I was unable to align it right below the opening parenthesis, just by using tabs. And when I did that with spaces, the checkpatch yelled at me for using spaces. Any suggestions how to do this without using spaces? I am using vim, I will try to find a workaround meanwhile.

Your comment hasn't made it to the list yet. Sometimes there is a delay or maybe it was blocked for some reason (html email?).

You are allowed to use spaces but you can't have 8 consecutive spaces and spaces are not allowed before a tab character. The way to align it is:

Quoted 8 lines
		ret = wait_event_interruptible_timeout(port->wait_tx,
						       !test_bit(IN_TX, &port->flags),
						       10);

[tab x6][space x7]!test_bit(IN_TX, &port->flags)

regards,
dan carpenter

Thank you Dan, I figured that out after a few failed attempts to align properly.

I was replying through Gmail web client, as I am new to mutt. I am getting the hang of it.

Signature · 2 lines
Regards,
Prakash