Skip to content

Commit

Permalink
PNPACPI: simplify irq_flags()
Browse files Browse the repository at this point in the history
No need for a temporary variable; just return the flags once we know them.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Adam Belay <abelay@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Aug 24, 2007
1 parent 1e0aa9a commit 4cec086
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,17 @@
*/
static int irq_flags(int triggering, int polarity)
{
int flag;

if (triggering == ACPI_LEVEL_SENSITIVE) {
if (polarity == ACPI_ACTIVE_LOW)
flag = IORESOURCE_IRQ_LOWLEVEL;
return IORESOURCE_IRQ_LOWLEVEL;
else
flag = IORESOURCE_IRQ_HIGHLEVEL;
return IORESOURCE_IRQ_HIGHLEVEL;
} else {
if (polarity == ACPI_ACTIVE_LOW)
flag = IORESOURCE_IRQ_LOWEDGE;
return IORESOURCE_IRQ_LOWEDGE;
else
flag = IORESOURCE_IRQ_HIGHEDGE;
return IORESOURCE_IRQ_HIGHEDGE;
}
return flag;
}

static void decode_irq_flags(int flag, int *triggering, int *polarity)
Expand Down

0 comments on commit 4cec086

Please sign in to comment.