From patchwork Mon Jun 4 08:52:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 162681 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 752F9B6F9A for ; Mon, 4 Jun 2012 18:53:35 +1000 (EST) Received: from localhost ([::1]:37471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbT2b-0000Qf-CT for incoming@patchwork.ozlabs.org; Mon, 04 Jun 2012 04:53:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbT1g-0006ol-Qx for qemu-devel@nongnu.org; Mon, 04 Jun 2012 04:52:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbT1Y-00042W-1Y for qemu-devel@nongnu.org; Mon, 04 Jun 2012 04:52:36 -0400 Received: from goliath.siemens.de ([192.35.17.28]:24251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbT1X-00041l-Ng for qemu-devel@nongnu.org; Mon, 04 Jun 2012 04:52:27 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id q548qPr8029317; Mon, 4 Jun 2012 10:52:25 +0200 Received: from mchn199C.mchp.siemens.de (atpczjyc.ww300.siemens.net [139.22.45.247]) by mail1.siemens.de (8.13.6/8.13.6) with SMTP id q548qMpv019518; Mon, 4 Jun 2012 10:52:25 +0200 From: Jan Kiszka To: "Michael S. Tsirkin" , qemu-devel Date: Mon, 4 Jun 2012 10:52:15 +0200 Message-Id: X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.28 Cc: Alex Williamson Subject: [Qemu-devel] [PATCH 07/13] pci: Make domain and bus unsigned in pci_read_devaddr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org It's the more appropriate type as there are no negative domain or bus values. Signed-off-by: Jan Kiszka --- 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 [[:]:], return -1 on error if funcp == NULL * [[:]:]., 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);