From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCaRD-0006Ia-03 for qemu-devel@nongnu.org; Thu, 22 Aug 2013 15:21:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCaR0-0001tI-Fo for qemu-devel@nongnu.org; Thu, 22 Aug 2013 15:20:54 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:39318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCaR0-0001so-1N for qemu-devel@nongnu.org; Thu, 22 Aug 2013 15:20:42 -0400 Received: by mail-wi0-f173.google.com with SMTP id en1so1121013wid.6 for ; Thu, 22 Aug 2013 12:20:41 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <52163F3C.9050300@redhat.com> Date: Thu, 22 Aug 2013 18:41:32 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1376875152-8584-1-git-send-email-weiyang@linux.vnet.ibm.com> <1377182371.25163.8.camel@ul30vt.home> In-Reply-To: <1377182371.25163.8.camel@ul30vt.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] kvm: shoten the parameter list for get_real_device() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: Wei Yang , aliguori@us.ibm.com, qemu-devel@nongnu.org Il 22/08/2013 16:39, Alex Williamson ha scritto: > On Mon, 2013-08-19 at 09:19 +0800, Wei Yang wrote: >> get_real_device() has 5 parameters with the last 4 is contained in the first >> structure. >> >> This patch removes the last 4 parameters and directly use them from the first >> parameter. >> >> Signed-off-by: Wei Yang > > > Seems harmless enough > > Acked-by: Alex Williamson Applying, thanks. Paolo >> --- >> hw/i386/kvm/pci-assign.c | 9 ++++----- >> 1 files changed, 4 insertions(+), 5 deletions(-) >> >> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c >> index 5618173..011764f 100644 >> --- a/hw/i386/kvm/pci-assign.c >> +++ b/hw/i386/kvm/pci-assign.c >> @@ -568,8 +568,7 @@ static int get_real_device_id(const char *devpath, uint16_t *val) >> return get_real_id(devpath, "device", val); >> } >> >> -static int get_real_device(AssignedDevice *pci_dev, uint16_t r_seg, >> - uint8_t r_bus, uint8_t r_dev, uint8_t r_func) >> +static int get_real_device(AssignedDevice *pci_dev) >> { >> char dir[128], name[128]; >> int fd, r = 0, v; >> @@ -582,7 +581,8 @@ static int get_real_device(AssignedDevice *pci_dev, uint16_t r_seg, >> dev->region_number = 0; >> >> snprintf(dir, sizeof(dir), "/sys/bus/pci/devices/%04x:%02x:%02x.%x/", >> - r_seg, r_bus, r_dev, r_func); >> + pci_dev->host.domain, pci_dev->host.bus, >> + pci_dev->host.slot, pci_dev->host.function); >> >> snprintf(name, sizeof(name), "%sconfig", dir); >> >> @@ -1769,8 +1769,7 @@ static int assigned_initfn(struct PCIDevice *pci_dev) >> memcpy(dev->emulate_config_write, dev->emulate_config_read, >> sizeof(dev->emulate_config_read)); >> >> - if (get_real_device(dev, dev->host.domain, dev->host.bus, >> - dev->host.slot, dev->host.function)) { >> + if (get_real_device(dev)) { >> error_report("pci-assign: Error: Couldn't get real device (%s)!", >> dev->dev.qdev.id); >> goto out; > > > > >