提交 8f5001f9 编写于 作者: I Igor Mammedov 提交者: Michael S. Tsirkin

pcihp: replace enable|disable_device() with oneliners

enable_device() and disable_device() functions aren't reused anywere,
so replace them with respective oneliners at call sites.
Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 5a2223ca
...@@ -177,16 +177,6 @@ void acpi_pcihp_reset(AcpiPciHpState *s) ...@@ -177,16 +177,6 @@ void acpi_pcihp_reset(AcpiPciHpState *s)
acpi_pcihp_update(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, int acpi_pcihp_device_hotplug(AcpiPciHpState *s, PCIDevice *dev,
PCIHotplugState state) PCIHotplugState state)
{ {
...@@ -204,9 +194,9 @@ int acpi_pcihp_device_hotplug(AcpiPciHpState *s, PCIDevice *dev, ...@@ -204,9 +194,9 @@ int acpi_pcihp_device_hotplug(AcpiPciHpState *s, PCIDevice *dev,
} }
if (state == PCI_HOTPLUG_ENABLED) { if (state == PCI_HOTPLUG_ENABLED) {
enable_device(s, bsel, slot); s->acpi_pcihp_pci_status[bsel].up |= (1U << slot);
} else { } else {
disable_device(s, bsel, slot); s->acpi_pcihp_pci_status[bsel].down |= (1U << slot);
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册