aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2015-06-04 12:34:38 +0200
committerMichael S. Tsirkin <mst@redhat.com>2015-06-10 18:15:06 +0200
commitcc52ea90f835aa66d431db712b22f8b15bec2e46 (patch)
treedceca8f9d1770940ec6da13a55b67d9f4ec9e5bd /hw
parentfc004905c5b4b7568aad50087c156a5f4dfae1a7 (diff)
virtio-pci: drop identical virtio_pci_cap
Now the three struct virtio_pci_caps are identical, lets drop two of them ;) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio/virtio-pci.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 440db10339..771bbd5224 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1341,16 +1341,8 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
if (modern) {
- struct virtio_pci_cap common = {
- .cap_len = sizeof common,
- .bar = modern_mem_bar,
- };
- struct virtio_pci_cap isr = {
- .cap_len = sizeof isr,
- .bar = modern_mem_bar,
- };
- struct virtio_pci_cap device = {
- .cap_len = sizeof device,
+ struct virtio_pci_cap cap = {
+ .cap_len = sizeof cap,
.bar = modern_mem_bar,
};
struct virtio_pci_notify_cap notify = {
@@ -1367,9 +1359,9 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
2 * QEMU_VIRTIO_PCI_QUEUE_MEM_MULT *
VIRTIO_QUEUE_MAX);
virtio_pci_modern_regions_init(proxy);
- virtio_pci_modern_region_map(proxy, &proxy->common, &common);
- virtio_pci_modern_region_map(proxy, &proxy->isr, &isr);
- virtio_pci_modern_region_map(proxy, &proxy->device, &device);
+ virtio_pci_modern_region_map(proxy, &proxy->common, &cap);
+ virtio_pci_modern_region_map(proxy, &proxy->isr, &cap);
+ virtio_pci_modern_region_map(proxy, &proxy->device, &cap);
virtio_pci_modern_region_map(proxy, &proxy->notify, &notify.cap);
pci_register_bar(&proxy->pci_dev, modern_mem_bar,
PCI_BASE_ADDRESS_SPACE_MEMORY |