Thread (3 messages) 3 messages, 3 authors, 2017-05-15

Re: [PATCH 1/3] Fix ERROR: trailing statements should be on next line

From: Alex Williamson <hidden>
Date: 2017-05-15 03:20:56
Also in: lkml, netdev

Possibly related (same subject, not in this thread)

On Mon, 15 May 2017 05:58:05 +0300
"Michael S. Tsirkin" [off-list ref] wrote:
On Sun, May 14, 2017 at 07:51:28PM +0200, Maciek Fijalkowski wrote:
quoted
From: Maciej Fijalkowski <redacted>

Signed-off-by: Maciej Fijalkowski <redacted>  
I prefer the original form - ; isn't a full statement.
quoted
---
 drivers/net/virtio_net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 9320d96..f20dfb8 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -217,7 +217,8 @@ static void give_pages(struct receive_queue *rq, struct page *page)
 	struct page *end;
 
 	/* Find end of list, sew whole thing into vi->rq.pages. */
-	for (end = page; end->private; end = (struct page *)end->private);
+	for (end = page; end->private; end = (struct page *)end->private)
+		;
FWIW, I generally like to put a comment on the next line to make it
abundantly clear that there's nothing in the body of the loop, it's
also more aesthetically pleasing than a semi-colon on the line by
itself, ex. /* Nothing */;  It's just too easy to misinterpret the
loop otherwise, especially without gratuitous white space.  Thanks,

Alex

quoted
 	end->private = (unsigned long)rq->pages;
 	rq->pages = page;
 }
-- 
2.4.11  
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help