lkml.org 
[lkml]   [2008]   [Feb]   [23]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 24 Feb 2008 13:52:36 +1030
FromDavid Newall <>
SubjectRe: Merging of completely unreviewed drivers
Jan Engelhardt wrote:
> static void blah(void)
> {
> 	if (foo) {
> 		bar;
> 		bar2;
> 		return;
> 	}
> 	if (this) {
> 		that;
> 		that2;
> 		return;
> 	}
> 	/* yay, got rid of two levels of indent! */
> 	good day;
> 	good day2;
> }

I like this style.  It's more readable than the alternative that you
showed.  If you hate returns mid-procedure, as some purists do, the
following is also good:

static void blah(void)
{
	if (foo) {
		bar;
		bar2;
	} else if (this) {
		that;
		that2;
	} else {
		good day;
		good day2;
	}
}


\
 
 \ /
  Last update: 2008-02-24 05:55    [from the cache]
©2003-2008