Index: target/linux/atheros/files/include/asm-mips/mach-atheros/ar531x.h =================================================================== --- target/linux/atheros/files/include/asm-mips/mach-atheros/ar531x.h (revision 10877) +++ target/linux/atheros/files/include/asm-mips/mach-atheros/ar531x.h (working copy) @@ -12,29 +12,6 @@ #endif /* - * C access to CLZ instruction - * (count leading zeroes). - */ -static inline int clz(unsigned long val) -{ - int ret; - - __asm__ volatile ( - ".set\tnoreorder\n\t" - ".set\tnoat\n\t" - ".set\tmips32\n\t" - "clz\t%0,%1\n\t" - ".set\tmips0\n\t" - ".set\tat\n\t" - ".set\treorder" - : "=r" (ret) - : "r" (val) - ); - - return ret; -} - -/* * Atheros CPUs before the AR2315 are using MIPS 4Kc core, later designs are * using MIPS 4KEc R2 core. This makes it easy to determine the board at runtime. */ Index: target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c =================================================================== --- target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c (revision 10877) +++ target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c (working copy) @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,7 @@ if (!pend) return; - do_IRQ(AR531X_GPIO_IRQ_BASE + 31 - clz(pend)); + do_IRQ(AR531X_GPIO_IRQ_BASE + fls(pend) - 1); }