Re: [PATCH][MIPS]: AR7 GPIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 12 Jan 2008 18:18:02 +0100, Matteo Croce <technoboy85@xxxxxxxxx> wrote:
> +static inline void gpio_set_value(unsigned gpio, int value)
> +{
> +	static void __iomem *gpio_out;
> +	unsigned tmp;
> +
> +	if (!gpio_out)
> +		gpio_out = (void __iomem *)
> +				KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
> +
> +	tmp = readl(gpio_out) & ~(1 << gpio);
> +	if (value)
> +		tmp |= 1 << gpio;
> +	writel(tmp, gpio_out);
> +}

It seems the compiler can calculate gpio_out value at compile time.
So I think caching it just make the function slower.

---
Atsushi Nemoto


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux