Skip to contentSkip to conversation

MIPS: Loongson: irq.c: Misc cleanups

PATCH In review Shinya Kuribayashi 2 participants 2 messages Jun 27, 2010 – Jun 28, 2010 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Loongson: irq.c: Misc cleanups

* Remove unnecessary 'if (int_status & (1 <<10))' statement
* s/if (foo != 0)/if (foo)/
* Remove unused 'inst_status &= ~(1 << i);' line

---
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(-)
arch/mips/loongson/common/irq.c +4 -7
index 20e7328..25a11df 100644
@@ -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);
 	}
 }
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw

Hi,

Looks find to me, thanks!

Quoted 44 lines · Shinya Kuribayashi

* Remove unnecessary 'if (int_status & (1 <<10))' statement
* s/if (foo != 0)/if (foo)/
* Remove unused 'inst_status &= ~(1 << i);' line

---
 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(-)
arch/mips/loongson/common/irq.c +4 -8
index 20e7328..25a11df 100644
@@ -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