From: Zhen Lei <thunder.leizhen@huawei.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Jason Cooper <jason@lakedaemon.net>,
Marc Zyngier <marc.zyngier@arm.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Cc: Zefan Li <lizefan@huawei.com>, Xinwei Hu <huxinwei@huawei.com>,
"Tianhong Ding" <dingtianhong@huawei.com>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
Zhen Lei <thunder.leizhen@huawei.com>
Subject: [PATCH 1/1] irqchip/gicv3: remove duplicated parameter testing
Date: Wed, 1 Apr 2015 14:54:58 +0800 [thread overview]
Message-ID: <1427871298-11976-1-git-send-email-thunder.leizhen@huawei.com> (raw)
Test hardware irq number from small to large, and add a blank above
each comment. To make it more clear.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
drivers/irqchip/irq-gic-v3.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index fd8850d..f43cfa1 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -611,12 +611,6 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
/* SGIs are private to the core kernel */
if (hw < 16)
return -EPERM;
- /* Nothing here */
- if (hw >= gic_data.irq_nr && hw < 8192)
- return -EPERM;
- /* Off limits */
- if (hw >= GIC_ID_NR)
- return -EPERM;
/* PPIs */
if (hw < 32) {
@@ -624,13 +618,17 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_percpu_devid_irq, NULL, NULL);
set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
+ return 0;
}
+
/* SPIs */
- if (hw >= 32 && hw < gic_data.irq_nr) {
+ if (hw < gic_data.irq_nr) {
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_fasteoi_irq, NULL, NULL);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ return 0;
}
+
/* LPIs */
if (hw >= 8192 && hw < GIC_ID_NR) {
if (!gic_dist_supports_lpis())
@@ -638,9 +636,10 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_fasteoi_irq, NULL, NULL);
set_irq_flags(irq, IRQF_VALID);
+ return 0;
}
- return 0;
+ return -EPERM;
}
static int gic_irq_domain_xlate(struct irq_domain *d,
--
1.8.0
next reply other threads:[~2015-04-01 6:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-01 6:54 Zhen Lei [this message]
2015-04-01 7:23 ` Marc Zyngier
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=1427871298-11976-1-git-send-email-thunder.leizhen@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=dingtianhong@huawei.com \
--cc=huxinwei@huawei.com \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=marc.zyngier@arm.com \
--cc=tglx@linutronix.de \
--cc=wangkefeng.wang@huawei.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
all inboxes | Powered by JetHome®