[PATCH v2 4/6] [POWERPC] QE: implement support for the GPIO LIB API

Anton Vorontsov cbouatmailru at gmail.com
Thu May 1 09:24:30 EST 2008


On Wed, Apr 30, 2008 at 06:03:45PM -0500, Timur Tabi wrote:
> Anton Vorontsov wrote:
> 
> > What is the problem with returning (int)(u32 & u32) value?
> 
> Technically, a signed int is smaller than an unsigned int, so a value of
> 0x80000000 won't fit in an 'int'.

They're of the same size. And because of that, we'll not lose
information, so (int)(0x80000000U) still != 0, it is just negative.

> > You've asked to remove "!!" stuff and now purposing exactly the
> > same... :-?
> 
> The !! stuff was because the function was returning a boolean value, so non-zero
> == TRUE.  I don't think the return value from 'get' is a technically a boolean,
> so I'm assuming that the spec says the return value should be 0 or 1, to reflect
> the value of that GPIO pin.

No. The spec indeed says that 0 for low, non-0 for high.

-- 
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2



More information about the Linuxppc-dev mailing list