linux-mips
[Top] [All Lists]

[PATCH] MIPS: Loongson: irq.c: Misc cleanups

To: wuzhangjin@gmail.com
Subject: [PATCH] MIPS: Loongson: irq.c: Misc cleanups
From: Shinya Kuribayashi <skuribay@pobox.com>
Date: Sun, 27 Jun 2010 22:52:01 +0900
Cc: linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id :date:from:mime-version:to:cc:subject:content-type :content-transfer-encoding; s=sasl; bh=oZgv6YAERmHRchoaE9nB0NuuS Nk=; b=WR5QX9Wt+xbuwtbd/e0qTWFs+AyB78MvpRQmp8oyWihadvxNxh4u0TQFX Y2lQdOPt/2rw5hd2KWwhJjh4cE1AUyn3BA9gnfWH2bhGwyCuimnYBSO1a6MMaUgY KE6PQZ546T5uworBEdCdwB8xT2DyIFSP61+EcaSf4Loo8hpAZU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=pobox.com; h=message-id:date :from:mime-version:to:cc:subject:content-type :content-transfer-encoding; q=dns; s=sasl; b=A5B3Nc/cdANt5G7p1HF XvQdDgP4gx0ZKavU5xLJGouG5NPD88U4KaDY0NLacLQzb0yBAfNqlXcNpV63p0fq VFHMGwufAC41blREEfR2chyw7S5HI0JkhQ0VximRgujdrm6NTaeHohxzq/1exOT6 7D/ptObnNuz7HkASGHkgaRFU=
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4
* Remove unnecessary 'if (int_status & (1 <<10))' statement
* s/if (foo != 0)/if (foo)/
* Remove unused 'inst_status &= ~(1 << i);' line

Signed-off-by: Shinya Kuribayashi <skuribay@pobox.com>
---
 Noticed while I'm reworking on interrupt code for EMMA2RH.
 This is not for inclusion, but just for letting Wu-san know.

 arch/mips/loongson/common/irq.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/mips/loongson/common/irq.c b/arch/mips/loongson/common/irq.c
index 20e7328..25a11df 100644
--- a/arch/mips/loongson/common/irq.c
+++ b/arch/mips/loongson/common/irq.c
@@ -21,19 +21,16 @@ void bonito_irqdispatch(void)
 
        /* workaround the IO dma problem: let cpu looping to allow DMA finish */
        int_status = LOONGSON_INTISR;
-       if (int_status & (1 << 10)) {
-               while (int_status & (1 << 10)) {
-                       udelay(1);
-                       int_status = LOONGSON_INTISR;
-               }
+       while (int_status & (1 << 10)) {
+               udelay(1);
+               int_status = LOONGSON_INTISR;
        }
 
        /* Get pending sources, masked by current enables */
        int_status = LOONGSON_INTISR & LOONGSON_INTEN;
 
-       if (int_status != 0) {
+       if (int_status) {
                i = __ffs(int_status);
-               int_status &= ~(1 << i);
                do_IRQ(LOONGSON_IRQ_BASE + i);
        }
 }
-- 
1.7.1


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