From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/2] versatile_pci: cleanup
Date: Mon, 8 Feb 2010 23:43:08 +0200 [thread overview]
Message-ID: <20100208214308.GC28285@redhat.com> (raw)
In-Reply-To: <cover.1265665089.git.mst@redhat.com>
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 <mst@redhat.com>
---
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
next prev parent reply other threads:[~2010-02-08 21:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1265665089.git.mst@redhat.com>
2010-02-08 21:41 ` [Qemu-devel] [PATCH 1/2] versatile_pci: convert to symbolic names Michael S. Tsirkin
2010-02-10 19:43 ` Anthony Liguori
2010-02-08 21:43 ` Michael S. Tsirkin [this message]
2010-02-10 19:43 ` [Qemu-devel] [PATCH 2/2] versatile_pci: cleanup Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100208214308.GC28285@redhat.com \
--to=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).