From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NebR1-0007Xk-U6 for qemu-devel@nongnu.org; Mon, 08 Feb 2010 16:46:23 -0500 Received: from [199.232.76.173] (port=38291 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NebR0-0007XX-O4 for qemu-devel@nongnu.org; Mon, 08 Feb 2010 16:46:22 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NebQz-0006bE-KB for qemu-devel@nongnu.org; Mon, 08 Feb 2010 16:46:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7685) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NebQz-0006au-3p for qemu-devel@nongnu.org; Mon, 08 Feb 2010 16:46:21 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o18LkKDO013980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Feb 2010 16:46:20 -0500 Received: from redhat.com (vpn1-6-71.ams2.redhat.com [10.36.6.71]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o18LkIws023018 for ; Mon, 8 Feb 2010 16:46:19 -0500 Date: Mon, 8 Feb 2010 23:43:08 +0200 From: "Michael S. Tsirkin" Message-ID: <20100208214308.GC28285@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] [PATCH 2/2] versatile_pci: cleanup List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cleanup versatile_pci: no need to re-set fields to zero (pci core sets 0 already), use set_word for status field. Compile-tested only, but seems obvious. Signed-off-by: Michael S. Tsirkin --- hw/versatile_pci.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/versatile_pci.c b/hw/versatile_pci.c index e58b7f4..7f79348 100644 --- a/hw/versatile_pci.c +++ b/hw/versatile_pci.c @@ -147,15 +147,8 @@ static int versatile_pci_host_init(PCIDevice *d) pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_XILINX); /* Both boards have the same device ID. Oh well. */ pci_config_set_device_id(d->config, PCI_DEVICE_ID_XILINX_XC2VP30); - /* TODO: no need to clear command */ - pci_set_byte(d->config + PCI_COMMAND, 0x00); - pci_set_byte(d->config + PCI_COMMAND + 1, 0x00); - /* TODO: convert to set_word */ - pci_set_byte(d->config + PCI_STATUS, PCI_STATUS_66MHZ); - pci_set_byte(d->config + PCI_STATUS + 1, PCI_STATUS_DEVSEL_MEDIUM >> 8); - /* TODO: no need to clear revision/prog ifc */ - pci_set_byte(d->config + PCI_REVISION_ID, 0x00); - pci_set_byte(d->config + PCI_CLASS_PROG, 0x00); + pci_set_word(d->config + PCI_STATUS, + PCI_STATUS_66MHZ | PCI_STATUS_DEVSEL_MEDIUM); pci_config_set_class(d->config, PCI_CLASS_PROCESSOR_CO); pci_set_byte(d->config + PCI_LATENCY_TIMER, 0x10); return 0; -- 1.6.6.144.g5c3af