lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20060905112239.GA11064@elte.hu>
Date:	Tue, 5 Sep 2006 13:22:39 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Jan Engelhardt <jengelh@...ux01.gwdg.de>
Cc:	Steven Whitehouse <swhiteho@...hat.com>,
	linux-kernel@...r.kernel.org,
	Russell Cattelan <cattelan@...hat.com>,
	David Teigland <teigland@...hat.com>, hch@...radead.org
Subject: Re: [PATCH 07/16] GFS2: Directory handling


* Jan Engelhardt <jengelh@...ux01.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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ