Re: [patch 2.6.20-rc1 4/6] PXA GPIO wrappers

From: David Brownell
Date: Thu Dec 21 2006 - 14:26:18 EST


On Thursday 21 December 2006 7:03 am, pHilipp Zabel wrote:
> On 12/21/06, Nicolas Pitre <nico@xxxxxxx> wrote:

> +static inline void __gpio_set_value(unsigned gpio, int value)
> +{
> + if (value)
> + GPSR(gpio) = GPIO_bit(gpio);
> + else
> + GPCR(gpio) = GPIO_bit(gpio);
> +}
> +
> +#define gpio_set_value(gpio,value) \
> + (__builtin_constant_p(gpio) ? \

Should that be testing for _both_ gpio and value being constant?
I tend to think it should (assuming nonconstant 'variable' means
this costs more than a function call) ...

> + __gpio_set_value(gpio, value) : \
> + pxa_gpio_set_value(gpio, value))
-
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/