[PATCH 3/7] POWERPC: Move generic cpm2 stuff to powerpc

Dan Malek dan at embeddedalley.com
Sun Sep 17 02:09:34 EST 2006

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.  :-)

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).


	-- Dan

More information about the Linuxppc-dev mailing list