qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 07/13] pci: Make domain and bus unsigned in pci_read


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH 07/13] pci: Make domain and bus unsigned in pci_read_devaddr
Date: Mon, 4 Jun 2012 10:52:15 +0200

It's the more appropriate type as there are no negative domain or bus
values.

Signed-off-by: Jan Kiszka <address@hidden>
---
 hw/pci-hotplug.c |    4 ++--
 hw/pci.c         |   11 ++++++-----
 hw/pci.h         |    4 ++--
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index c55d8b9..e0ea8bb 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -108,7 +108,7 @@ static int scsi_hot_add(Monitor *mon, DeviceState *adapter,
 int pci_drive_hot_add(Monitor *mon, const QDict *qdict,
                       DriveInfo *dinfo, int type)
 {
-    int dom, pci_bus;
+    unsigned int dom, pci_bus;
     unsigned slot;
     PCIDevice *dev;
     const char *pci_addr = qdict_get_str(qdict, "pci_addr");
@@ -257,7 +257,7 @@ void pci_device_hot_add(Monitor *mon, const QDict *qdict)
 static int pci_device_hot_remove(Monitor *mon, const char *pci_addr)
 {
     PCIDevice *d;
-    int dom, bus;
+    unsigned int dom, bus;
     unsigned slot;
     Error *local_err = NULL;
 
diff --git a/hw/pci.c b/hw/pci.c
index 5b99f4b..d4c8b71 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -512,8 +512,9 @@ static void pci_set_default_subsystem_id(PCIDevice *pci_dev)
  * Parse [[<domain>:]<bus>:]<slot>, return -1 on error if funcp == NULL
  *       [[<domain>:]<bus>:]<slot>.<func>, return -1 on error
  */
-static int pci_parse_devaddr(const char *addr, int *domp, int *busp,
-                      unsigned int *slotp, unsigned int *funcp)
+static int pci_parse_devaddr(const char *addr, unsigned int *domp,
+                             unsigned int *busp, unsigned int *slotp,
+                             unsigned int *funcp)
 {
     const char *p;
     char *e;
@@ -571,8 +572,8 @@ static int pci_parse_devaddr(const char *addr, int *domp, 
int *busp,
     return 0;
 }
 
-int pci_read_devaddr(Monitor *mon, const char *addr, int *domp, int *busp,
-                     unsigned *slotp)
+int pci_read_devaddr(Monitor *mon, const char *addr, unsigned int *domp,
+                     unsigned int *busp, unsigned *slotp)
 {
     /* strip legacy tag */
     if (!strncmp(addr, "pci_addr=", 9)) {
@@ -587,7 +588,7 @@ int pci_read_devaddr(Monitor *mon, const char *addr, int 
*domp, int *busp,
 
 PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
 {
-    int dom, bus;
+    unsigned int dom, bus;
     unsigned slot;
 
     if (!devaddr) {
diff --git a/hw/pci.h b/hw/pci.h
index e7237cf..0c38c36 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -340,8 +340,8 @@ PCIDevice *pci_find_device(PCIBus *bus, int bus_num, 
uint8_t devfn);
 int pci_qdev_find_device(const char *id, PCIDevice **pdev);
 PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr);
 
-int pci_read_devaddr(Monitor *mon, const char *addr, int *domp, int *busp,
-                     unsigned *slotp);
+int pci_read_devaddr(Monitor *mon, const char *addr, unsigned int *domp,
+                     unsigned int *busp, unsigned *slotp);
 
 void pci_device_deassert_intx(PCIDevice *dev);
 
-- 
1.7.3.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]