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:19:26 +0200 [thread overview]
Message-ID: <20060905111926.GB8195@elte.hu> (raw)
In-Reply-To: <Pine.LNX.4.61.0609051111480.28583@yvahk01.tjqt.qr>
* Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
> >> > >+ if ((char *)cur + cur_rec_len >= bh_end) {
> >> > >+ if ((char *)cur + cur_rec_len > bh_end) {
> >> > >+ gfs2_consist_inode(dip);
> >> > >+ return -EIO;
> >> > >+ }
> >> > >+ return -ENOENT;
> >> > >+ }
> >> >
> >> > 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;
> >> >
> >> ok
> >
> >this one is not OK! Firstly, Jan, and i mentioned this before, please
> >stop using 'if(', it is highly inconsistent and against basic taste. We
> >only use this construct for function calls (and macros), not for C
> >statements.
>
> Now there is no rule in CodingStyle for this yet. [...]
as i told you before, it is basic taste. Show me the CodingStyle rules
that forbids this construct:
if((((i+-+-+-+-+1-1))))
var=0;;;;;;;
instead of:
if (i)
var = 0;
?
You will find no explicit rule in CodingStyle that explicitly forbids
any aspect of this line, because CodingStyle mainly concentrates on the
harder to follow rules. So please use common sense in combination with
CodingStyle.
(And even if you dont agree with the taste, "if ( )" is done by 98% of
core code, so for the sake of consistency it's the thing to follow.)
> 11:17 gwdg-wb04A:~/linux > grep -Pri '(if|for|while)\(' . | wc -l
> 24242
>
> [To be honest, I also present the other number:]
> 11:17 gwdg-wb04A:~/linux > grep -Pri '(if|for|while) \(' . | wc -l
> 380895
>
> Although a minority, it does not seem so uncommon.
What is your point?
ugly code is not at all uncommon, sadly - but i'm glad that it's only 6%
in this particular case (and 1.9% for core kernel code).
> [...] Plus, I was wanting to show how to reorder the construct, so
> change in whitespace between "if" and "(" is outoftopic.
it is not offtopic, because you _are_ nitpicking over style issues
(which is OK and desirable, if not overdone), while still seeming to
believe that "if(" is fine :-) The one who judges others is judged by
higher standards. In other words, i'm trying to fix the guy who is
fixing others ;-)
Ingo
next prev parent reply other threads:[~2006-09-05 11:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-31 13:34 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 [this message]
2006-09-05 11:22 ` Ingo Molnar
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=20060905111926.GB8195@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 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®