All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Steven Whitehouse <swhiteho@redhat.com>,
	linux-kernel@vger.kernel.org,
	Russell Cattelan <cattelan@redhat.com>,
	David Teigland <teigland@redhat.com>,
	hch@infradead.org
Subject: Re: [PATCH 07/16] GFS2: Directory handling
Date: Tue, 5 Sep 2006 13:22:39 +0200	[thread overview]
Message-ID: <20060905112239.GA11064@elte.hu> (raw)
In-Reply-To: <Pine.LNX.4.61.0609051111480.28583@yvahk01.tjqt.qr>


* Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:

> >Secondly, whenever we have curly braces in the first block, we tend to 
> >do it in the second block too, for easier parsing. I.e.:
> >
> >	if ((char *)cur + cur_rec_len > bh_end) {
> >		gfs2_consist_inode(dip);
> >		return -EIO;
> >	} else {
> >		if ((char *)cur + cur_rec_len == bh_end)
> >			return -ENOENT;
> >	}
> 
> I would very much like to do just this
> 
> 		many insns;
> 	} else if(...) {
> 		single insn;
> 	}

yeah, almost - what we want is:

		many insns;
	} else if (...) {
		single insn;
	}

;-)

> but again, some people think no {} should be there because it's just a 
> single insn. [...]

i used to be such a person but got converted: it makes visual sense to 
have symmetry of curly braces. So it's fine to have:

	if (...)
		single insn;
	else
		single insn;

but otherwise, if any of the blocks grows larger than 1 line, it should 
be curly braces all around.

	Ingo

  parent reply	other threads:[~2006-09-05 11:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31 13:34 [PATCH 07/16] GFS2: Directory handling Steven Whitehouse
2006-09-04 11:35 ` Jan Engelhardt
2006-09-05  8:44   ` Steven Whitehouse
2006-09-05  8:43     ` Ingo Molnar
2006-09-05  8:58       ` Andreas Schwab
2006-09-05 10:58         ` Ingo Molnar
2006-09-05  9:22       ` Jan Engelhardt
2006-09-05 11:19         ` Ingo Molnar
2006-09-05 11:22         ` Ingo Molnar [this message]
2006-09-05 14:02       ` Steven Whitehouse
  -- strict thread matches above, loose matches on Subject: below --
2006-04-21 16:16 Steven Whitehouse
2006-04-21 16:16 ` Christoph Hellwig
2006-04-24  9:16   ` Steven Whitehouse

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=20060905112239.GA11064@elte.hu \
    --to=mingo@elte.hu \
    --cc=cattelan@redhat.com \
    --cc=hch@infradead.org \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swhiteho@redhat.com \
    --cc=teigland@redhat.com \
    /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 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.