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

Michał Nazarewicz m.nazarewicz at samsung.com
Mon Oct 11 09:19:23 EDT 2010


On Mon, 11 Oct 2010 14:21:30 +0200, Peter Korsgaard <jacmet at sunsite.dk> wrote:
> Se my other reply. I don't feel strongly about it, but I for one don't
> remember the precedence rules for !! and << offhand.

A bit off-topic, but hopefuly it'll help someone:

1. (In C,) one argument operators have binding tighter than two (or three) argument
    operators. (The only exception to this rule is the :: operator in C++ which has
    the tighest binding of all operators.)
2. The next rule, is that one argument postfix operators has tigter binding
    then prefix operators, thus *a++ is *(a++).

I find those two rules let me understand most operatrs use cases.  Hope this
helps. :)


Also, I haven't followed the patch from the beginnig (just stumbled accross
some mails), but anoter possible solution to the problem would be to change
the type of "value" to "bool".

-- 
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--



More information about the linux-arm-kernel mailing list