mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'Alex Williamson'" <alex.williamson@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: Maciek Fijalkowski <macfij7@wp.pl>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org" 
	<virtualization@lists.linux-foundation.org>
Subject: RE: [PATCH 1/3] Fix ERROR: trailing statements should be on next line
Date: Mon, 15 May 2017 14:25:40 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFF5B0B@AcuExch.aculab.com> (raw)
In-Reply-To: <20170514212048.24ee7667@t450s.home>

From: Alex Williamson
> Sent: 15 May 2017 04:21
...
> > >  	/* 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,

My preference is to put 'continue;' on a line by itself.
Or even move the termination condition into the loop:
	for (end = page;; end = (struct page *)end->private)
		if (!end->private)
			break;

(oh, is that cast needed??)

	David

      reply	other threads:[~2017-05-15 14:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-14 17:51 Maciek Fijalkowski
2017-05-14 17:51 ` [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses Maciek Fijalkowski
2017-05-14 18:48   ` kbuild test robot
2017-05-15  0:25   ` Andrew Lunn
2017-05-15  2:56   ` Michael S. Tsirkin
2017-05-14 17:51 ` [PATCH 3/3] Fix ERROR: code indent should use tabs where possible Maciek Fijalkowski
2017-05-15  3:00   ` Michael S. Tsirkin
2017-05-15  2:58 ` [PATCH 1/3] Fix ERROR: trailing statements should be on next line Michael S. Tsirkin
2017-05-15  3:20   ` Alex Williamson
2017-05-15 14:25     ` David Laight [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=063D6719AE5E284EB5DD2968C1650D6DCFFF5B0B@AcuExch.aculab.com \
    --to=david.laight@aculab.com \
    --cc=alex.williamson@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macfij7@wp.pl \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®