Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
To: linux-mips@linux-mips.org
Cc: shinya.kuribayashi@necel.com
Subject: [PATCH 06/12] MIPS: EMMA2RH: Remove emma2rh_irq_base global variable
Date: Fri, 24 Oct 2008 01:31:16 +0900	[thread overview]
Message-ID: <4900A6D4.2080308@ruby.dti.ne.jp> (raw)
In-Reply-To: <4900A510.3000101@ruby.dti.ne.jp>

Let's use immediate value, instead.  This also saves memory footprint,
and probably a little bit faster.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
---
 arch/mips/emma/common/irq_emma2rh.c |   15 ++++++---------
 arch/mips/emma/markeins/irq.c       |    4 ++--
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/arch/mips/emma/common/irq_emma2rh.c b/arch/mips/emma/common/irq_emma2rh.c
index 23ac959..4f84fed 100644
--- a/arch/mips/emma/common/irq_emma2rh.c
+++ b/arch/mips/emma/common/irq_emma2rh.c
@@ -41,19 +41,17 @@
 /* number of total irqs supported by EMMA2RH */
 #define	NUM_EMMA2RH_IRQ		96
 
-static int emma2rh_irq_base = -1;
-
 void ll_emma2rh_irq_enable(int);
 void ll_emma2rh_irq_disable(int);
 
 static void emma2rh_irq_enable(unsigned int irq)
 {
-	ll_emma2rh_irq_enable(irq - emma2rh_irq_base);
+	ll_emma2rh_irq_enable(irq - EMMA2RH_IRQ_BASE);
 }
 
 static void emma2rh_irq_disable(unsigned int irq)
 {
-	ll_emma2rh_irq_disable(irq - emma2rh_irq_base);
+	ll_emma2rh_irq_disable(irq - EMMA2RH_IRQ_BASE);
 }
 
 struct irq_chip emma2rh_irq_controller = {
@@ -64,15 +62,14 @@ struct irq_chip emma2rh_irq_controller = {
 	.unmask = emma2rh_irq_enable,
 };
 
-void emma2rh_irq_init(u32 irq_base)
+void emma2rh_irq_init(void)
 {
 	u32 i;
 
-	for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ; i++)
-		set_irq_chip_and_handler(i, &emma2rh_irq_controller,
+	for (i = 0; i < NUM_EMMA2RH_IRQ; i++)
+		set_irq_chip_and_handler(EMMA2RH_IRQ_BASE + i,
+					 &emma2rh_irq_controller,
 					 handle_level_irq);
-
-	emma2rh_irq_base = irq_base;
 }
 
 void ll_emma2rh_irq_enable(int emma2rh_irq)
diff --git a/arch/mips/emma/markeins/irq.c b/arch/mips/emma/markeins/irq.c
index dcb9392..86b9b6a 100644
--- a/arch/mips/emma/markeins/irq.c
+++ b/arch/mips/emma/markeins/irq.c
@@ -55,7 +55,7 @@
 
 extern void emma2rh_sw_irq_init(u32 base);
 extern void emma2rh_gpio_irq_init(u32 base);
-extern void emma2rh_irq_init(u32 base);
+extern void emma2rh_irq_init(void);
 extern void emma2rh_irq_dispatch(void);
 
 static struct irqaction irq_cascade = {
@@ -102,7 +102,7 @@ void __init arch_init_irq(void)
 	emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~GPIO_PCI);
 
 	/* init all controllers */
-	emma2rh_irq_init(EMMA2RH_IRQ_BASE);
+	emma2rh_irq_init();
 	emma2rh_sw_irq_init(EMMA2RH_SW_IRQ_BASE);
 	emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE);
 	mips_cpu_irq_init();

  parent reply	other threads:[~2008-10-23 16:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23 16:23 [PATCH 00/10] Restructure EMMA2RH port Shinya Kuribayashi
2008-10-23 16:27 ` [PATCH 01/12] MIPS: Add CONFIG_CPU_R5500 for NEC VR5500 series processors Shinya Kuribayashi
2008-10-23 16:29 ` [PATCH 03/12] MIPS: Move arch/mips/emma2rh/ into arch/mips/emma/ Shinya Kuribayashi
2008-10-23 16:30 ` [PATCH 04/12] MIPS: Move <asm/emma2rh> to <asm/emma> dir Shinya Kuribayashi
2008-10-27 15:07   ` [PATCH] MIPS: EMMA2RH: Fix incorrect header references Shinya Kuribayashi
2008-10-27 15:36     ` Ralf Baechle
2008-10-23 16:30 ` [PATCH 05/12] MIPS: Remove emma2rh_sync on read operation Shinya Kuribayashi
2008-10-23 16:31 ` Shinya Kuribayashi [this message]
2008-10-23 16:31 ` [PATCH 07/12] MIPS: EMMA2RH: Remove emma2rh_sw_irq_base Shinya Kuribayashi
2008-10-23 16:32 ` [PATCH 08/12] MIPS: EMMA2RH: Remove emma2rh_gpio_irq_base Shinya Kuribayashi
2008-10-23 17:20   ` Markus Gothe
2008-10-23 16:32 ` [PATCH 09/12] MIPS: Fold arch/mips/emma/{common,markeins}/irq*.c into markeins/irq.c Shinya Kuribayashi
2008-10-23 16:33 ` [PATCH 10/12] MIPS: Markeins: Remove runtime debug prints Shinya Kuribayashi
2008-10-23 16:35 ` [PATCH 11/12] MIPS: Markeins: Extract ll_emma2rh_* functions Shinya Kuribayashi
2008-10-23 16:36 ` [PATCH 12/12] MIPS: Markeins: Remove unnecessary define and cleanup comments, etc Shinya Kuribayashi
2008-10-23 21:00 ` [PATCH 02/12] MIPS: EMMA Kconfig reorganization Shinya Kuribayashi
2008-10-27 10:47 ` [PATCH 00/10] Restructure EMMA2RH port Ralf Baechle
2008-10-27 11:05   ` Shinya Kuribayashi
2008-10-27 14:50     ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4900A6D4.2080308@ruby.dti.ne.jp \
    --to=skuribay@ruby.dti.ne.jp \
    --cc=linux-mips@linux-mips.org \
    --cc=shinya.kuribayashi@necel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox