lkml.org 
[lkml]   [2006]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] neofb: add more logic to determine sensibility of register readback
Date
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/

\
 
 \ /
  Last update: 2006-02-10 17:44    [W:0.069 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site