From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0SUH-0001l0-KF for qemu-devel@nongnu.org; Thu, 04 Jun 2015 06:35:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0SUC-0006km-LF for qemu-devel@nongnu.org; Thu, 04 Jun 2015 06:35:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0SUC-0006k2-FJ for qemu-devel@nongnu.org; Thu, 04 Jun 2015 06:34:56 -0400 From: Gerd Hoffmann Date: Thu, 4 Jun 2015 12:34:38 +0200 Message-Id: <1433414083-9720-30-git-send-email-kraxel@redhat.com> In-Reply-To: <1433414083-9720-1-git-send-email-kraxel@redhat.com> References: <1433414083-9720-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 29/33] virtio-pci: drop identical virtio_pci_cap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , Gerd Hoffmann , "Michael S. Tsirkin" Now the three struct virtio_pci_caps are identical, lets drop two of them ;) Signed-off-by: Gerd Hoffmann --- hw/virtio/virtio-pci.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 7cffe8a..7baeb7e 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1334,16 +1334,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 = { @@ -1360,9 +1352,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, ¬ify.cap); pci_register_bar(&proxy->pci_dev, modern_mem_bar, PCI_BASE_ADDRESS_SPACE_MEMORY | -- 1.8.3.1