Commit 4cec086b authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown

PNPACPI: simplify irq_flags()

No need for a temporary variable; just return the flags once we know them.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: default avatarAdam Belay <abelay@novell.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 1e0aa9ad
...@@ -34,20 +34,17 @@ ...@@ -34,20 +34,17 @@
*/ */
static int irq_flags(int triggering, int polarity) static int irq_flags(int triggering, int polarity)
{ {
int flag;
if (triggering == ACPI_LEVEL_SENSITIVE) { if (triggering == ACPI_LEVEL_SENSITIVE) {
if (polarity == ACPI_ACTIVE_LOW) if (polarity == ACPI_ACTIVE_LOW)
flag = IORESOURCE_IRQ_LOWLEVEL; return IORESOURCE_IRQ_LOWLEVEL;
else else
flag = IORESOURCE_IRQ_HIGHLEVEL; return IORESOURCE_IRQ_HIGHLEVEL;
} else { } else {
if (polarity == ACPI_ACTIVE_LOW) if (polarity == ACPI_ACTIVE_LOW)
flag = IORESOURCE_IRQ_LOWEDGE; return IORESOURCE_IRQ_LOWEDGE;
else else
flag = IORESOURCE_IRQ_HIGHEDGE; return IORESOURCE_IRQ_HIGHEDGE;
} }
return flag;
} }
static void decode_irq_flags(int flag, int *triggering, int *polarity) static void decode_irq_flags(int flag, int *triggering, int *polarity)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment