Received: from [140.186.70.92] (port=42679 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OQgwD-0008NH-TO for qemu-devel@nongnu.org; Mon, 21 Jun 2010 09:21:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OQgw5-0003aJ-ME for qemu-devel@nongnu.org; Mon, 21 Jun 2010 09:21:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27014) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OQgw5-0003aD-Fg for qemu-devel@nongnu.org; Mon, 21 Jun 2010 09:21:13 -0400 Date: Mon, 21 Jun 2010 16:15:58 +0300 From: "Michael S. Tsirkin" Message-ID: <20100621131558.GC10511@redhat.com> References: <96f25acdbbd369aa8b1217244c422e88d7572c9e.1277100005.git.yamahata@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96f25acdbbd369aa8b1217244c422e88d7572c9e.1277100005.git.yamahata@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH v4 4/6] pci: don't overwrite multi functio bit in pci header type. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: blauwirbel@gmail.com, yu.liu@freescale.com, qemu-devel@nongnu.org, aurelien@aurel32.net, paul@codesourcery.com On Mon, Jun 21, 2010 at 03:03:59PM +0900, Isaku Yamahata wrote: > diff --git a/hw/piix4.c b/hw/piix4.c > index f75951b..03926a7 100644 > --- a/hw/piix4.c > +++ b/hw/piix4.c > @@ -93,8 +93,7 @@ static int piix4_initfn(PCIDevice *d) > pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL); > pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82371AB_0); // 82371AB/EB/MB PIIX4 PCI-to-ISA bridge > pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_ISA); > - pci_conf[PCI_HEADER_TYPE] = > - PCI_HEADER_TYPE_NORMAL | PCI_HEADER_TYPE_MULTI_FUNCTION; // header_type = PCI_multifunction, generic > + pci_conf[PCI_HEADER_TYPE] |= PCI_HEADER_TYPE_MULTI_FUNCTION; > IMO it's cleaner not to change the same line twice. Just move this bit to the next patch. > piix4_dev = d; > qemu_register_reset(piix4_reset, d); > diff --git a/hw/piix_pci.c b/hw/piix_pci.c > index 16645cd..0b0c92b 100644 > --- a/hw/piix_pci.c > +++ b/hw/piix_pci.c > @@ -208,7 +208,6 @@ static int i440fx_initfn(PCIDevice *dev) > pci_config_set_device_id(d->dev.config, PCI_DEVICE_ID_INTEL_82441); > d->dev.config[0x08] = 0x02; // revision > pci_config_set_class(d->dev.config, PCI_CLASS_BRIDGE_HOST); > - d->dev.config[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL; // header_type > > d->dev.config[I440FX_SMRAM] = 0x02; > > @@ -337,8 +336,7 @@ static int piix3_initfn(PCIDevice *dev) > pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL); > pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82371SB_0); // 82371SB PIIX3 PCI-to-ISA bridge (Step A1) > pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_ISA); > - pci_conf[PCI_HEADER_TYPE] = > - PCI_HEADER_TYPE_NORMAL | PCI_HEADER_TYPE_MULTI_FUNCTION; // header_type = PCI_multifunction, generic > + pci_conf[PCI_HEADER_TYPE] |= PCI_HEADER_TYPE_MULTI_FUNCTION; > same here