From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LtHDf-0007lS-HK for qemu-devel@nongnu.org; Mon, 13 Apr 2009 04:08:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LtHDa-0007kj-NK for qemu-devel@nongnu.org; Mon, 13 Apr 2009 04:08:42 -0400 Received: from [199.232.76.173] (port=46345 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtHDa-0007kf-Jt for qemu-devel@nongnu.org; Mon, 13 Apr 2009 04:08:38 -0400 Received: from mx2.redhat.com ([66.187.237.31]:38263) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LtHDZ-0000rc-Ky for qemu-devel@nongnu.org; Mon, 13 Apr 2009 04:08:37 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3D88a7G010545 for ; Mon, 13 Apr 2009 04:08:36 -0400 Message-ID: <49E2F301.70301@redhat.com> Date: Mon, 13 Apr 2009 11:08:33 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch 1/2] qemu: move pci devfn "first free" assignment to separate function References: <20090413035311.009617911@amt.cnet> <20090413035340.221112109@amt.cnet> In-Reply-To: <20090413035340.221112109@amt.cnet> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Armbruster Marcelo Tosatti wrote: > Move pci device address assignment to a separate function. > > Index: trunk/hw/pci.c > =================================================================== > --- trunk.orig/hw/pci.c > +++ trunk/hw/pci.c > @@ -121,6 +121,16 @@ int pci_bus_num(PCIBus *s) > return s->bus_num; > } > > +int pci_bus_assign_dev_addr(PCIBus *bus) > +{ > + int devfn; > + > + for(devfn = bus->devfn_min ; devfn < 256; devfn += 8) > + if (!bus->devices[devfn]) > + return devfn; > + return -1; > +} > s/assign/allocate/ or get_free, to avoid confusion with device assignment (and given that you aren't assigning anything). -- error compiling committee.c: too many arguments to function