From 2d40d566d7e934e0c9ae2d5f18d55808b6e8db97 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Mon, 24 May 2010 17:41:47 +0000 Subject: as3525: don't destroy status when calculating IRQ number in UIRQ() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26260 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/system-as3525.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'firmware/target/arm/as3525') diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 80804d41da..f215300f75 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c @@ -87,7 +87,6 @@ static const char * const irqname[] = static void UIRQ(void) { - unsigned int irq_no = 0; bool masked = false; int status = VIC_IRQ_STATUS; if(status == 0) @@ -99,8 +98,7 @@ static void UIRQ(void) if(status == 0) panicf("Unhandled IRQ (source unknown!)"); - while((status >>= 1)) - irq_no++; + unsigned irq_no = find_first_set_bit(status); panicf("Unhandled %smasked IRQ %02X: %s (status 0x%8X)", masked ? "" : "no", irq_no, irqname[irq_no], status); -- cgit v1.2.3