Messages in this thread | | | From | Kyle Moffett <> | Subject | Re: [PATCH] neofb: add more logic to determine sensibility of register readback | Date | Fri, 10 Feb 2006 11:41:34 -0500 |
| |
On Feb 10, 2006, at 06:53, Antonino A. Daplas wrote: > Christian Trefzer wrote: >> + par->PanelDispCntlRegRead = 0; >> + par->PanelDispCntlRegRead = 0; >> + par->PanelDispCntlRegRead = 0; >> + par->PanelDispCntlRegRead = 0; >> + par->PanelDispCntlRegRead = 1; > > You can save a few lines by > > par->PanelDispCntlRegRead = (blank_mode) ? 0 : 1;
How about the really simple so-obvious-its-impossible-to-misread solution?
par->PanelDispCntlRegRead = !blank_mode;
Personally I tend to get ?: constructs confused a _lot_, especially mistaking the really short ones like x?0:1 and x?1:0. Those two are usually better represented as !x or !!x, respectively.
Cheers, Kyle Moffett
-- I lost interest in "blade servers" when I found they didn't throw knives at people who weren't supposed to be in your machine room. -- Anthony de Boer
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |