From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: [PATCH v2 7/8] pci-assign: Use MSIX_PAGE_SIZE Date: Tue, 31 Jan 2012 22:33:06 -0700 Message-ID: <20120201053306.9843.67444.stgit@bling.home> References: <20120201052203.9843.80792.stgit@bling.home> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: alex.williamson@redhat.com, avi@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, shashidhar.patil@gmail.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:3556 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751162Ab2BAFdL (ORCPT ); Wed, 1 Feb 2012 00:33:11 -0500 In-Reply-To: <20120201052203.9843.80792.stgit@bling.home> Sender: kvm-owner@vger.kernel.org List-ID: We've already got it defined, use it. Signed-off-by: Alex Williamson --- hw/device-assignment.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index fe10a23..71685ee 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -1468,7 +1468,7 @@ static void msix_reset(AssignedDevice *dev) return; } - memset(dev->msix_table, 0, 0x1000); + memset(dev->msix_table, 0, MSIX_PAGE_SIZE); for (i = 0, entry = dev->msix_table; i < dev->msix_max; i++, entry++) { entry->ctrl = cpu_to_le32(0x1); /* Masked */ @@ -1477,7 +1477,7 @@ static void msix_reset(AssignedDevice *dev) static int assigned_dev_register_msix_mmio(AssignedDevice *dev) { - dev->msix_table = mmap(NULL, 0x1000, PROT_READ|PROT_WRITE, + dev->msix_table = mmap(NULL, MSIX_PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, 0, 0); if (dev->msix_table == MAP_FAILED) { fprintf(stderr, "fail allocate msix_table! %s\n", strerror(errno)); @@ -1499,7 +1499,7 @@ static void assigned_dev_unregister_msix_mmio(AssignedDevice *dev) memory_region_destroy(&dev->mmio); - if (munmap(dev->msix_table, 0x1000) == -1) { + if (munmap(dev->msix_table, MSIX_PAGE_SIZE) == -1) { fprintf(stderr, "error unmapping msix_table! %s\n", strerror(errno)); }