]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
pcihp: replace enable|disable_device() with oneliners
authorIgor Mammedov <imammedo@redhat.com>
Mon, 3 Feb 2014 10:44:57 +0000 (11:44 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 5 Feb 2014 14:55:49 +0000 (16:55 +0200)
enable_device() and disable_device() functions aren't reused anywere,
so replace them with respective oneliners at call sites.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/acpi/pcihp.c

index 4345f5d70d757a2345105fc5538eed3750f91e71..464739aaa1e4da307cc6a1861892c58d8f2ac82e 100644 (file)
@@ -177,16 +177,6 @@ void acpi_pcihp_reset(AcpiPciHpState *s)
     acpi_pcihp_update(s);
 }
 
-static void enable_device(AcpiPciHpState *s, unsigned bsel, int slot)
-{
-    s->acpi_pcihp_pci_status[bsel].up |= (1U << slot);
-}
-
-static void disable_device(AcpiPciHpState *s, unsigned bsel, int slot)
-{
-    s->acpi_pcihp_pci_status[bsel].down |= (1U << slot);
-}
-
 int acpi_pcihp_device_hotplug(AcpiPciHpState *s, PCIDevice *dev,
                               PCIHotplugState state)
 {
@@ -204,9 +194,9 @@ int acpi_pcihp_device_hotplug(AcpiPciHpState *s, PCIDevice *dev,
     }
 
     if (state == PCI_HOTPLUG_ENABLED) {
-        enable_device(s, bsel, slot);
+        s->acpi_pcihp_pci_status[bsel].up |= (1U << slot);
     } else {
-        disable_device(s, bsel, slot);
+        s->acpi_pcihp_pci_status[bsel].down |= (1U << slot);
     }
 
     return 0;