Skip to content

Commit

Permalink
genirq: No need to mask non trigger mode flags before __irq_set_trigg…
Browse files Browse the repository at this point in the history
…er()

Some callers of __irq_set_trigger() masks all flags except trigger mode
flags. This is unnecessary, ase __irq_set_trigger() already does this
before usage of flags.

[ tglx: Moved the flag mask and adjusted comment. Removed the hunk in
  	enable_percpu_irq() as it is required there ]

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Link: http://lkml.kernel.org/r/20160719095408.13778-1-kuleshovmail@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
0xAX authored and KAGA-KOKO committed Sep 6, 2016
1 parent 545d5d6 commit 00b992d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion kernel/irq/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ int irq_set_irq_type(unsigned int irq, unsigned int type)
if (!desc)
return -EINVAL;

type &= IRQ_TYPE_SENSE_MASK;
ret = __irq_set_trigger(desc, type);
irq_put_desc_busunlock(desc, flags);
return ret;
Expand Down
5 changes: 2 additions & 3 deletions kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,16 +669,15 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned long flags)
return 0;
}

flags &= IRQ_TYPE_SENSE_MASK;

if (chip->flags & IRQCHIP_SET_TYPE_MASKED) {
if (!irqd_irq_masked(&desc->irq_data))
mask_irq(desc);
if (!irqd_irq_disabled(&desc->irq_data))
unmask = 1;
}

/* caller masked out all except trigger mode flags */
/* Mask all flags except trigger mode */
flags &= IRQ_TYPE_SENSE_MASK;
ret = chip->irq_set_type(&desc->irq_data, flags);

switch (ret) {
Expand Down

0 comments on commit 00b992d

Please sign in to comment.