Hi, On Mon, Nov 03, 2008 at 11:48:56PM +0900, Atsushi Nemoto wrote: > Well, the linux gpio framework uses 0 for low, _nonzero_ for high. > You should not assume the bitval is 0 or 1. Good point. I was thinking about this potential problem, too. This is why the mentioned function contains the following line (sadly too far off to occur in the patch): | bitval = !!bitval; /* map parameter to {0,1} */ I put that separately to not make the below lines even more unreadable. > val &= ~(!bitval << offset); /* unset bit if bitval == 0 */ > val |= (!!bitval << offset); /* set bit if bitval != 0 */ But as a boolean inverse has to be used anyway, your solution looks more elegant than mine. Greetings, Phil