Re: [PATCH] neofb: add more logic to determine sensibility of register readback

From: Kyle Moffett
Date: Fri Feb 10 2006 - 11:39:44 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/