From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@amazon.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH v4 1/5] pcihp: replace enable|disable_device() with oneliners
Date: Mon, 3 Feb 2014 11:44:57 +0100 [thread overview]
Message-ID: <1391424301-22703-2-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1391424301-22703-1-git-send-email-imammedo@redhat.com>
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>
---
hw/acpi/pcihp.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 4345f5d..464739a 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -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;
--
1.7.1
next prev parent reply other threads:[~2014-02-03 10:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-03 10:44 [Qemu-devel] [PATCH v4 0/5] pc: make ACPI pcihp more reusable Igor Mammedov
2014-02-03 10:44 ` Igor Mammedov [this message]
2014-02-03 10:44 ` [Qemu-devel] [PATCH v4 2/5] pcihp: make PCI hotplug mmio handlers indifferent to PCI_HOTPLUG_ADDR Igor Mammedov
2014-02-03 10:44 ` [Qemu-devel] [PATCH v4 3/5] pcihp: make pci_read() mmio calback compatible with legacy ACPI hotplug Igor Mammedov
2014-02-03 10:45 ` [Qemu-devel] [PATCH v4 4/5] pcihp: remove unused AcpiPciHpPciStatus.device_present field Igor Mammedov
2014-02-03 10:45 ` [Qemu-devel] [PATCH v4 5/5] hw:piix4:acpi: reuse pcihp code for legacy PCI hotplug Igor Mammedov
2014-02-03 13:58 ` [Qemu-devel] [PATCH v4 0/5] pc: make ACPI pcihp more reusable Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391424301-22703-2-git-send-email-imammedo@redhat.com \
--to=imammedo@redhat.com \
--cc=aliguori@amazon.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).