linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Fri, 29 Jul 2005 16:02:02 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/07/29 16:01:56

Modified files:
        arch/mips/tx4938/toshiba_rbtx4938: irq.c 

Log message:
        Use fls instead of the homegrown fls function.

diff -urN linux/arch/mips/tx4938/toshiba_rbtx4938/irq.c 
linux/arch/mips/tx4938/toshiba_rbtx4938/irq.c
--- linux/arch/mips/tx4938/toshiba_rbtx4938/irq.c       2005/07/26 19:24:22     
1.3
+++ linux/arch/mips/tx4938/toshiba_rbtx4938/irq.c       2005/07/29 15:01:56     
1.4
@@ -114,19 +114,6 @@
 #define TOSHIBA_RBTX4938_IOC_INTR_ENAB 0xb7f02000
 #define TOSHIBA_RBTX4938_IOC_INTR_STAT 0xb7f0200a
 
-u8
-last_bit2num(u8 num)
-{
-       u8 i = ((sizeof(num)*8)-1);
-
-       do {
-               if (num & (1<<i))
-                       break;
-       } while ( --i );
-
-       return i;
-}
-
 int
 toshiba_rbtx4938_irq_nested(int sw_irq)
 {
@@ -135,7 +122,7 @@
        level3 = reg_rd08(TOSHIBA_RBTX4938_IOC_INTR_STAT) & 0xff;
        if (level3) {
                 /* must use last_bit2num so onboard ATA has priority */
-               sw_irq = TOSHIBA_RBTX4938_IRQ_IOC_BEG + last_bit2num(level3);
+               sw_irq = TOSHIBA_RBTX4938_IRQ_IOC_BEG + fls(level3) - 1;
        }
 
        wbflush();

<Prev in Thread] Current Thread [Next in Thread>