PNPACPI: simplify irq_flags()
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Wed, 15 Aug 2007 16:32:09 +0000 (10:32 -0600)
committerLen Brown <len.brown@intel.com>
Fri, 24 Aug 2007 05:27:23 +0000 (01:27 -0400)
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>
drivers/pnp/pnpacpi/rsparser.c

index 51478c0842208e0ebae23370c9575ba2fe4729d7..a0784fe5bcd8fff57b3c36dfbf7fb56cecf56ad2 100644 (file)
  */
 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)