On Sat, 12 Jan 2008 18:18:02 +0100, Matteo Croce <technoboy85@xxxxxxxxx> wrote: > This new patch caches addresses as suggested by Atsushi Nemoto Well, I cannot remember any suggestion about caches. I just said you should kill all volatiles. > +static inline int gpio_get_value(unsigned gpio) > +{ > + static unsigned addr; > + > + if (!addr) { > + void __iomem *gpio_in = (void __iomem *) > + KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT); > + addr = readl(gpio_in); > + } > + > + return addr & (1 << gpio); > +} Anyway, this is absolutely broken. You are caching the GPIO value, not the address. --- Atsushi Nemoto