pci: clean up of pci_set_default_subsystem_id().
authorIsaku Yamahata <yamahata@valinux.co.jp>
Thu, 27 May 2010 05:42:06 +0000 (14:42 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 31 May 2010 13:33:52 +0000 (16:33 +0300)
Use pci accessor function.
don't return value because it always return 0 and
the caller doesn't check the return value.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci.c

index 8d84651f19f0df1ddf68a358e431bc0a79b474ea..3362842bf2b5ccd24b46c8d2b919f1773416899f 100644 (file)
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -419,14 +419,12 @@ int pci_device_load(PCIDevice *s, QEMUFile *f)
     return ret;
 }
 
-static int pci_set_default_subsystem_id(PCIDevice *pci_dev)
+static void pci_set_default_subsystem_id(PCIDevice *pci_dev)
 {
-    uint16_t *id;
-
-    id = (void*)(&pci_dev->config[PCI_SUBSYSTEM_VENDOR_ID]);
-    id[0] = cpu_to_le16(pci_default_sub_vendor_id);
-    id[1] = cpu_to_le16(pci_default_sub_device_id);
-    return 0;
+    pci_set_word(pci_dev->config + PCI_SUBSYSTEM_VENDOR_ID,
+                 pci_default_sub_vendor_id);
+    pci_set_word(pci_dev->config + PCI_SUBSYSTEM_ID,
+                 pci_default_sub_device_id);
 }
 
 /*