Re: [PATCH] xillybus: place 'else' on same line as '}'

From: Eli Billauer
Date: Mon Jul 14 2014 - 02:56:06 EST


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.


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

Signed-off-by: Jeremiah Mahler<jmmahler@xxxxxxxxx>
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;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at