diff mbox

[6/9] virtio: drop identical virtio_pci_cap

Message ID 1428669111-24225-7-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann April 10, 2015, 12:31 p.m. UTC
Now the three struct virtio_pci_caps are identical,
lets drop two of them ;)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/virtio/virtio-pci.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)
diff mbox

Patch

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 037f4ea..229f93d 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1309,16 +1309,8 @@  static void virtio_pci_device_plugged(DeviceState *d)
 
 
     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 = {
@@ -1334,9 +1326,9 @@  static void virtio_pci_device_plugged(DeviceState *d)
                            2 * QEMU_VIRTIO_PCI_QUEUE_MEM_MULT *
                            VIRTIO_PCI_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 |