From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Dan Malek <dan@embeddedalley.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
Paul Mackerras <paulus@samba.org>,
linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH 3/7] POWERPC: Move generic cpm2 stuff to powerpc
Date: Sun, 17 Sep 2006 08:55:51 +1000 [thread overview]
Message-ID: <1158447351.14473.233.camel@localhost.localdomain> (raw)
In-Reply-To: <FF0EF221-284E-4E0A-8576-EFC7E1CE0DE4@embeddedalley.com>
On Sat, 2006-09-16 at 12:09 -0400, Dan Malek wrote:
> On Sep 16, 2006, at 4:36 AM, Stephen Rothwell wrote:
>
> >
> >> + if (brg < 4) {
> >> + bp = (uint *)&cpm2_immr->im_brgc1;
> >> + }
> >> + else {
> >
> > Normally:
> > if (brg < 4)
> > bp = (uint *)&cpm2_immr->im_brgc1;
> > else {
>
> Sorry, I'm going to nit-pick right back. This isn't
> "normal", it's just your preference. :-)
Nothing is "normal" in C coding style, it's all a matter of preference.
Not having braces around a single-line statement is indeed a preference
shared by the majority of the kernel maintainers, and thus becomes
de-facto the rule, which we can then qualify as "normal" in the context
of the linux kernel :)
> When the "else" part contains braces, the "if"
> part should as well. If this get modified and
> nested some day in the future, this can cause
> a very subtle coding error.
>
> No one should ever be criticized for using too
> many braces, provided it is artistically pleasing.
>
> "Normally," the if-else without braces is only
> used when there are single statements on
> both paths of the logic. The only exception
> is the else-if that emulates a case statement
> (when other exceptions also apply, see K&R).
>
> Thanks.
>
> -- Dan
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
next prev parent reply other threads:[~2006-09-16 22:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-15 17:37 [PATCH 0/7]Add support for CPM2 peripherals and 8560 eval board Vitaly Bordug
2006-09-15 17:38 ` [PATCH 1/7] POWERPC: Add cpm2 stuff support to the fsl_soc.c Vitaly Bordug
2006-09-16 8:20 ` Stephen Rothwell
2006-09-15 17:39 ` [PATCH 2/7] cpm_uart: make it possible to utilize from powerpc Vitaly Bordug
2006-09-15 17:39 ` [PATCH 3/7] POWERPC: Move generic cpm2 stuff to powerpc Vitaly Bordug
2006-09-16 8:36 ` Stephen Rothwell
2006-09-16 16:09 ` Dan Malek
2006-09-16 22:55 ` Benjamin Herrenschmidt [this message]
2006-09-16 23:08 ` Stephen Rothwell
2006-09-15 17:39 ` [PATCH 4/7] POWERPC: Add support for the mpc8560 eval board Vitaly Bordug
2006-09-15 17:39 ` [PATCH 5/7] POWERPC: Get rid of remapping the whole immr Vitaly Bordug
2006-09-15 17:39 ` [PATCH 6/7] POWERPC: overhaul with cpm2_map mechanism Vitaly Bordug
2006-09-15 17:39 ` [PATCH 7/7] POWERPC: Bring the fs_no calculation to the relevant SoC enumeration Vitaly Bordug
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=1158447351.14473.233.camel@localhost.localdomain \
--to=benh@kernel.crashing.org \
--cc=dan@embeddedalley.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=sfr@canb.auug.org.au \
/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;
as well as URLs for NNTP newsgroup(s).