mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-03 15:55:38 +00:00
irq: simplify handle_domain_{irq,nmi}()
There's no need for handle_domain_{irq,nmi}() to open-code the NULL check performed by handle_irq_desc(), nor the resolution of the desc performed by generic_handle_domain_irq(). Use generic_handle_domain_irq() directly, as this is functioanlly equivalent and clearer. At the same time, delete the stale comments, which are no longer helpful. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Marc Zyngier <maz@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
4cb6f4df97
commit
d21e64027c
1 changed files with 4 additions and 20 deletions
|
@ -690,17 +690,11 @@ int handle_domain_irq(struct irq_domain *domain,
|
||||||
unsigned int hwirq, struct pt_regs *regs)
|
unsigned int hwirq, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
struct pt_regs *old_regs = set_irq_regs(regs);
|
struct pt_regs *old_regs = set_irq_regs(regs);
|
||||||
struct irq_desc *desc;
|
int ret;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
irq_enter();
|
irq_enter();
|
||||||
|
|
||||||
/* The irqdomain code provides boundary checks */
|
ret = generic_handle_domain_irq(domain, hwirq);
|
||||||
desc = irq_resolve_mapping(domain, hwirq);
|
|
||||||
if (likely(desc))
|
|
||||||
handle_irq_desc(desc);
|
|
||||||
else
|
|
||||||
ret = -EINVAL;
|
|
||||||
|
|
||||||
irq_exit();
|
irq_exit();
|
||||||
set_irq_regs(old_regs);
|
set_irq_regs(old_regs);
|
||||||
|
@ -721,24 +715,14 @@ int handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq,
|
||||||
struct pt_regs *regs)
|
struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
struct pt_regs *old_regs = set_irq_regs(regs);
|
struct pt_regs *old_regs = set_irq_regs(regs);
|
||||||
struct irq_desc *desc;
|
int ret;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NMI context needs to be setup earlier in order to deal with tracing.
|
* NMI context needs to be setup earlier in order to deal with tracing.
|
||||||
*/
|
*/
|
||||||
WARN_ON(!in_nmi());
|
WARN_ON(!in_nmi());
|
||||||
|
|
||||||
desc = irq_resolve_mapping(domain, hwirq);
|
ret = generic_handle_domain_irq(domain, hwirq);
|
||||||
|
|
||||||
/*
|
|
||||||
* ack_bad_irq is not NMI-safe, just report
|
|
||||||
* an invalid interrupt.
|
|
||||||
*/
|
|
||||||
if (likely(desc))
|
|
||||||
handle_irq_desc(desc);
|
|
||||||
else
|
|
||||||
ret = -EINVAL;
|
|
||||||
|
|
||||||
set_irq_regs(old_regs);
|
set_irq_regs(old_regs);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue