On Fri, 2007-04-06 at 14:38 -0700, Roland Dreier wrote: [snip] > If you have a git tree handy, you can do "git show 68380b58" and see > that Linus himself wrote: > > if (get_wq_data(work) == cwq > && work_pending(work) > && !list_empty(&work->entry)) { > > I have to admit that I would have put the &&s at the ends of the > previous lines rather than where Linus put them, but... egads! Linus > put spaces before the &&s to line them up nicely! My favorite form uses only tabs and would make that look like: if( get_wq_data(work) == cwq && work_pending(work) && !list_empty(&work->entry) ) { ... ... } Putting the && at the front would be OK with me too, it does make them more obvious and easier to find. I don't find too many people who like my style but that's OK. I think it makes everything a lot easier to read and everything lines up with 8-space tabs or 2 or 3 space tabs. Plus, reformatting other people's code gives me a good chance to read it as I go. :-) -- Zan Lynx <[email protected]>
Attachment:
signature.asc
Description: This is a digitally signed message part
- References:
- coding style for long conditions (WAS: Re: [PATCH 25/90] ... blinky leds!!)
- From: David Brownell <[email protected]>
- Re: coding style for long conditions (WAS: Re: [PATCH 25/90] ... blinky leds!!)
- From: Stefan Richter <[email protected]>
- Re: coding style for long conditions (WAS: Re: [PATCH 25/90] ... blinky leds!!)
- From: David Brownell <[email protected]>
- Re: coding style for long conditions
- From: Roland Dreier <[email protected]>
- coding style for long conditions (WAS: Re: [PATCH 25/90] ... blinky leds!!)
- Prev by Date: [patch 2.6.21-rc6] omap_cf, oops-on-suspend fix
- Next by Date: Re: init's children list is long and slows reaping children.
- Previous by thread: Re: coding style for long conditions
- Next by thread: Re: coding style for long conditions
- Index(es):