From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Cao Subject: Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn Date: Tue, 24 Aug 2010 20:16:32 +0800 Message-ID: <20100824121632.GG1971@kt> References: <20100824063307.GA10815@kt> <20100824064927.GB11495@kt> <20100824113521.GA7201@valinux.co.jp> <4C73B01A.1050908@redhat.com> <20100824120745.GC7201@valinux.co.jp> <4C73B55C.3050800@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Isaku Yamahata , Ken CC , kvm@vger.kernel.org, qemu-devel@nongnu.org, "Michael S. Tsirkin" To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:2502 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752438Ab0HXMQl (ORCPT ); Tue, 24 Aug 2010 08:16:41 -0400 Content-Disposition: inline In-Reply-To: <4C73B55C.3050800@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: > On 08/24/2010 03:07 PM, Isaku Yamahata wrote: > >On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: > >> On 08/24/2010 02:35 PM, Isaku Yamahata wrote: > >>>Add Cc: mst@redhat.com. > >>> > >>>MAX_PCI_SLOTS should be in pci.h instead of qdev.h? > >>>And the name should be start with PCI_ prefix for consistency? > >>> > >>>Except that, the patches look okay. > >>> > >>These aren't slots, are they? They are functions. > >The function checks if given $slot.$fn (or $slot) is valid. > >So it's slots. max 32. > > + assert(devfn< PCIBUS_MAX_DEVICES); > > > Looks like we're comparing a function number to PCIBUS_MAX_DEVICES. > PCIBUS_MAX_DEVICES is the size of PCIBus.devices[], I have added it in the first patch at the defination of struct PCIBus, line 50 hw/pci.c. so i think the better name of the macro should be PCIBUS_MAX_FN, right? Ken > -- > error compiling committee.c: too many arguments to function > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34356 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnsQg-0001SA-PO for qemu-devel@nongnu.org; Tue, 24 Aug 2010 08:16:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnsQf-0007PZ-Do for qemu-devel@nongnu.org; Tue, 24 Aug 2010 08:16:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22389) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnsQf-0007Ow-7n for qemu-devel@nongnu.org; Tue, 24 Aug 2010 08:16:37 -0400 Date: Tue, 24 Aug 2010 20:16:32 +0800 From: Chen Cao Subject: Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn Message-ID: <20100824121632.GG1971@kt> References: <20100824063307.GA10815@kt> <20100824064927.GB11495@kt> <20100824113521.GA7201@valinux.co.jp> <4C73B01A.1050908@redhat.com> <20100824120745.GC7201@valinux.co.jp> <4C73B55C.3050800@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C73B55C.3050800@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Isaku Yamahata , Ken CC , qemu-devel@nongnu.org, kvm@vger.kernel.org, "Michael S. Tsirkin" On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: > On 08/24/2010 03:07 PM, Isaku Yamahata wrote: > >On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: > >> On 08/24/2010 02:35 PM, Isaku Yamahata wrote: > >>>Add Cc: mst@redhat.com. > >>> > >>>MAX_PCI_SLOTS should be in pci.h instead of qdev.h? > >>>And the name should be start with PCI_ prefix for consistency? > >>> > >>>Except that, the patches look okay. > >>> > >>These aren't slots, are they? They are functions. > >The function checks if given $slot.$fn (or $slot) is valid. > >So it's slots. max 32. > > + assert(devfn< PCIBUS_MAX_DEVICES); > > > Looks like we're comparing a function number to PCIBUS_MAX_DEVICES. > PCIBUS_MAX_DEVICES is the size of PCIBus.devices[], I have added it in the first patch at the defination of struct PCIBus, line 50 hw/pci.c. so i think the better name of the macro should be PCIBUS_MAX_FN, right? Ken > -- > error compiling committee.c: too many arguments to function > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --