[PATCH] mxc/gpio: make _set_value work with values != 0/1

Peter Korsgaard jacmet at sunsite.dk
Mon Oct 11 08:47:41 EDT 2010


>>>>> "Sascha" == Sascha Hauer <s.hauer at pengutronix.de> writes:

Hi,

 Baruch> Alternative shorter version:
 Baruch> l = (__raw_readl(reg) & (~(1 << offset))) | (!!value << offset);

 Sascha> This is shorter but I find this significantly harder to read and I bet
 Sascha> the compiler generates the same code from both versions.

Agreed.

 >> Well, what do you know - I seem to be outnumbered ;)
 >> 
 >> Sasha, do you want the !! version instead? Then I'll resend.

 Sascha> I like the !! version. The only problem with this is that people tend
 Sascha> to try to remove the !! as it looks like a noop at first sight.

So what then? Do you want me to change to !!, resend with the extra
empty line removed or just let you remove the line when you apply it?

-- 
Bye, Peter Korsgaard



More information about the linux-arm-kernel mailing list