All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xillybus: place 'else' on same line as '}'
@ 2014-07-14  3:07 Jeremiah Mahler
  2014-07-14  6:40 ` Eli Billauer
  2014-07-18  0:18 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 6+ messages in thread
From: Jeremiah Mahler @ 2014-07-14  3:07 UTC (permalink / raw)
  To: Eli Billauer
  Cc: Greg Kroah-Hartman, Wei Yongjun, Kees Cook, Masanari Iida,
	Richard Weinberger, Ebru Akagunduz, devel, linux-kernel,
	Jeremiah Mahler

Place 'else' on same line as closing brace '}' as per
Documentation/CodingStyle.  Fixes 1 error found by checkpatch.pl.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
---
 drivers/staging/xillybus/xillybus_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/xillybus/xillybus_core.c b/drivers/staging/xillybus/xillybus_core.c
index ab6502c..7de4c11 100644
--- a/drivers/staging/xillybus/xillybus_core.c
+++ b/drivers/staging/xillybus/xillybus_core.c
@@ -546,8 +546,7 @@ static int xilly_setupchannels(struct xilly_endpoint *ep,
 			channel->rd_buffers = buffers;
 			rc = xilly_get_dma_buffers(ep, &rd_alloc, buffers,
 						   bufnum, bytebufsize);
-		}
-		else if (channelnum > 0) {
+		} else if (channelnum > 0) {
 			channel->num_wr_buffers = bufnum;
 
 			channel->seekable = seekable;
-- 
2.0.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] xillybus: place 'else' on same line as '}'
  2014-07-14  3:07 [PATCH] xillybus: place 'else' on same line as '}' Jeremiah Mahler
@ 2014-07-14  6:40 ` Eli Billauer
  2014-07-14  8:51   ` Dan Carpenter
  2014-07-14 16:02   ` Jeremiah Mahler
  2014-07-18  0:18 ` Greg Kroah-Hartman
  1 sibling, 2 replies; 6+ messages in thread
From: Eli Billauer @ 2014-07-14  6:40 UTC (permalink / raw)
  To: Jeremiah Mahler
  Cc: Greg Kroah-Hartman, Wei Yongjun, Kees Cook, Masanari Iida,
	Richard Weinberger, Ebru Akagunduz, devel, linux-kernel

Hi,

Thanks for this.

And since I looked at the part in Codingstyle that deals with if-else, I 
found another few mistakes regarding braces around a single statement. 
The rules say, it turns out, that if one of the clauses in an if-else is 
longer than one statement, both clauses should be wrapped with braces. 
This rule is broken in lines 162, 536 and 613 of the same file.

To avoid possible conflicts, I'll wait for this patch to be applied, and 
submit my corrections after that.

Regards,
    Eli


On 14/07/14 06:07, Jeremiah Mahler wrote:
> Place 'else' on same line as closing brace '}' as per
> Documentation/CodingStyle.  Fixes 1 error found by checkpatch.pl.
>
> Signed-off-by: Jeremiah Mahler<jmmahler@gmail.com>
> ---
>   drivers/staging/xillybus/xillybus_core.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/xillybus/xillybus_core.c b/drivers/staging/xillybus/xillybus_core.c
> index ab6502c..7de4c11 100644
> --- a/drivers/staging/xillybus/xillybus_core.c
> +++ b/drivers/staging/xillybus/xillybus_core.c
> @@ -546,8 +546,7 @@ static int xilly_setupchannels(struct xilly_endpoint *ep,
>   			channel->rd_buffers = buffers;
>   			rc = xilly_get_dma_buffers(ep,&rd_alloc, buffers,
>   						   bufnum, bytebufsize);
> -		}
> -		else if (channelnum>  0) {
> +		} else if (channelnum>  0) {
>   			channel->num_wr_buffers = bufnum;
>
>   			channel->seekable = seekable;
>    


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xillybus: place 'else' on same line as '}'
  2014-07-14  6:40 ` Eli Billauer
@ 2014-07-14  8:51   ` Dan Carpenter
  2014-07-14 16:08     ` Jeremiah Mahler
  2014-07-14 16:02   ` Jeremiah Mahler
  1 sibling, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2014-07-14  8:51 UTC (permalink / raw)
  To: Eli Billauer
  Cc: Jeremiah Mahler, devel, Kees Cook, Greg Kroah-Hartman,
	linux-kernel, Wei Yongjun, Richard Weinberger

On Mon, Jul 14, 2014 at 09:40:39AM +0300, Eli Billauer wrote:
> Hi,
> 
> Thanks for this.
> 
> And since I looked at the part in Codingstyle that deals with
> if-else, I found another few mistakes regarding braces around a
> single statement. The rules say, it turns out, that if one of the
> clauses in an if-else is longer than one statement, both clauses
> should be wrapped with braces. This rule is broken in lines 162, 536
> and 613 of the same file.
> 
> To avoid possible conflicts, I'll wait for this patch to be applied,
> and submit my corrections after that.

In theory there shouldn't be any need to wait because the rules about
which patches go in first are very clear and predictable.  First come
first serve.  Unless a patch is rejected.  And they are only rejected if
they violate some rule, but normally ok patches go in.

This patch is almost totally ok except it doesn't have "staging" in the
subject.  I'm not sure if that's enough to reject it...  Probably it's
ok and you should assume it will be merged.

The other reason that you don't need to wait is that this patch won't
conflict with the other patch you are proposing.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xillybus: place 'else' on same line as '}'
  2014-07-14  6:40 ` Eli Billauer
  2014-07-14  8:51   ` Dan Carpenter
@ 2014-07-14 16:02   ` Jeremiah Mahler
  1 sibling, 0 replies; 6+ messages in thread
From: Jeremiah Mahler @ 2014-07-14 16:02 UTC (permalink / raw)
  To: Eli Billauer; +Cc: linux-kernel

Eli,

On Mon, Jul 14, 2014 at 09:40:39AM +0300, Eli Billauer wrote:
> Hi,
> 
> Thanks for this.
> 
> And since I looked at the part in Codingstyle that deals with if-else, I
> found another few mistakes regarding braces around a single statement. The
> rules say, it turns out, that if one of the clauses in an if-else is longer
> than one statement, both clauses should be wrapped with braces. This rule is
> broken in lines 162, 536 and 613 of the same file.
> 

I just looked through CodingStyle, and you are right.  If braces are
used on one branch they should be used on all branches.

Interestingly, checkpatch.pl doesn't warn about these.

> ...

Cheers,
-- 
Jeremiah Mahler
jmmahler@gmail.com
http://github.com/jmahler

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xillybus: place 'else' on same line as '}'
  2014-07-14  8:51   ` Dan Carpenter
@ 2014-07-14 16:08     ` Jeremiah Mahler
  0 siblings, 0 replies; 6+ messages in thread
From: Jeremiah Mahler @ 2014-07-14 16:08 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-kernel

Dan,

On Mon, Jul 14, 2014 at 11:51:42AM +0300, Dan Carpenter wrote:
> On Mon, Jul 14, 2014 at 09:40:39AM +0300, Eli Billauer wrote:
> 
...
>
> This patch is almost totally ok except it doesn't have "staging" in the
> subject.  I'm not sure if that's enough to reject it...  Probably it's
> ok and you should assume it will be merged.
> 

I missed that.  A subject line like this would have been better.

  staging: xillybus: place 'else' on same line as '}'

>
...
> 
> regards,
> dan carpenter
> 

Thanks,
-- 
Jeremiah Mahler
jmmahler@gmail.com
http://github.com/jmahler

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xillybus: place 'else' on same line as '}'
  2014-07-14  3:07 [PATCH] xillybus: place 'else' on same line as '}' Jeremiah Mahler
  2014-07-14  6:40 ` Eli Billauer
@ 2014-07-18  0:18 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2014-07-18  0:18 UTC (permalink / raw)
  To: Jeremiah Mahler
  Cc: Eli Billauer, devel, Kees Cook, linux-kernel, Wei Yongjun,
	Richard Weinberger

On Sun, Jul 13, 2014 at 08:07:00PM -0700, Jeremiah Mahler wrote:
> Place 'else' on same line as closing brace '}' as per
> Documentation/CodingStyle.  Fixes 1 error found by checkpatch.pl.
> 
> Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
> ---
>  drivers/staging/xillybus/xillybus_core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Sorry, someone else sent this patch, which I applied already.  They did
so after you, but I missed this one as you didn't have the 'staging'
line on the Subject, my fault.

Sorry about that.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-18  0:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-14  3:07 [PATCH] xillybus: place 'else' on same line as '}' Jeremiah Mahler
2014-07-14  6:40 ` Eli Billauer
2014-07-14  8:51   ` Dan Carpenter
2014-07-14 16:08     ` Jeremiah Mahler
2014-07-14 16:02   ` Jeremiah Mahler
2014-07-18  0:18 ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.