2021-02-18 12:16:04

by Prakash Dubey

[permalink] [raw]
Subject: [PATCH] staging: fwserial: Fix alignment of function parameters

This patch fixes the following checkpatch.pl check:

CHECK: Alignment should match open parenthesis

Signed-off-by: Prakash Dubey <[email protected]>
---
drivers/staging/fwserial/fwserial.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index c368082aae1a..a92741b8b6c6 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -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);
--
2.25.1


2021-02-19 08:15:28

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] staging: fwserial: Fix alignment of function parameters

On Thu, Feb 18, 2021 at 03:58:51PM +0530, Prakash Dubey wrote:
> This patch fixes the following checkpatch.pl check:
>
> CHECK: Alignment should match open parenthesis
>
> Signed-off-by: Prakash Dubey <[email protected]>
> ---
> drivers/staging/fwserial/fwserial.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
> index c368082aae1a..a92741b8b6c6 100644
> --- a/drivers/staging/fwserial/fwserial.c
> +++ b/drivers/staging/fwserial/fwserial.c
> @@ -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

2021-02-19 10:43:29

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] staging: fwserial: Fix alignment of function parameters

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

2021-02-19 11:55:10

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] staging: fwserial: Fix alignment of function parameters

On Fri, Feb 19, 2021 at 11:39:27AM +0100, Greg KH wrote:
> 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

2021-02-19 12:16:23

by Prakash Dubey

[permalink] [raw]
Subject: Re: [PATCH] staging: fwserial: Fix alignment of function parameters

On Fri, Feb 19, 2021 at 02:52:21PM +0300, Dan Carpenter wrote:
> On Fri, Feb 19, 2021 at 11:39:27AM +0100, Greg KH wrote:
> > 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

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.

--
Regards,
Prakash