[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-1.2 v5 14/14] pci: Tidy up PCI host bridges
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH for-1.2 v5 14/14] pci: Tidy up PCI host bridges |
Date: |
Mon, 13 Aug 2012 15:32:22 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 |
Am 13.08.2012 15:14, schrieb Anthony Liguori:
> Andreas Färber <address@hidden> writes:
>
>> diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
>> index df70cd2..8937030 100644
>> --- a/hw/spapr_pci.c
>> +++ b/hw/spapr_pci.c
>> @@ -36,16 +36,18 @@ static PCIDevice *find_dev(sPAPREnvironment *spapr,
>> uint64_t buid, uint32_t config_addr)
>> {
>> int devfn = (config_addr >> 8) & 0xFF;
>> - sPAPRPHBState *phb;
>> + sPAPRPHBState *sphb;
>>
>> - QLIST_FOREACH(phb, &spapr->phbs, list) {
>> + QLIST_FOREACH(sphb, &spapr->phbs, list) {
>> + PCIHostState *phb;
>> BusChild *kid;
>>
>> - if (phb->buid != buid) {
>> + if (sphb->buid != buid) {
>> continue;
>> }
>>
>> - QTAILQ_FOREACH(kid, &phb->host_state.bus->qbus.children, sibling) {
>> + phb = PCI_HOST_BRIDGE(sphb);
>> + QTAILQ_FOREACH(kid, &BUS(phb->bus)->children, sibling) {
>> PCIDevice *dev = (PCIDevice *)kid->child;
>> if (dev->devfn == devfn) {
>> return dev;
>> @@ -319,7 +321,7 @@ static int spapr_phb_init(SysBusDevice *s)
>> pci_spapr_set_irq, pci_spapr_map_irq, phb,
>> &phb->memspace, &phb->iospace,
>> PCI_DEVFN(0, 0), PCI_NUM_PINS);
>> - phb->host_state.bus = bus;
>> + PCI_HOST_BRIDGE(phb)->bus = bus;
>
> I think you meant:
>
> PCI_HOST_BRIDGE(sphb)->bus
>
> But really you meant:
>
> phb->bus = bus;
The patch is misleading here, in the initfn phb historically is
sPAPRPHBState, not PCIHostState.
But you are right that this inline macro usage should be fixed - will
solve by squashing phb -> sphb renaming into the spapr_pci patch.
Thanks,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH for-1.2 v5 07/14] ppc4xx_pci: QOM'ify ppc4xx PCI host bridge, (continued)
- [Qemu-devel] [PATCH for-1.2 v5 07/14] ppc4xx_pci: QOM'ify ppc4xx PCI host bridge, Andreas Färber, 2012/08/01
- [Qemu-devel] [PATCH for-1.2 v5 08/14] ppce500_pci: QOM'ify e500 PCI host bridge, Andreas Färber, 2012/08/01
- [Qemu-devel] [PATCH for-1.2 v5 09/14] prep_pci: QOM'ify Raven PCI host bridge, Andreas Färber, 2012/08/01
- [Qemu-devel] [PATCH for-1.2 v5 10/14] spapr_pci: QOM'ify sPAPR PCI host bridge, Andreas Färber, 2012/08/01
- [Qemu-devel] [PATCH for-1.2 v5 11/14] unin_pci: QOM'ify UniNorth PCI host bridges, Andreas Färber, 2012/08/01
- [Qemu-devel] [PATCH for-1.2 v5 12/14] pci_host: Turn into SysBus-derived QOM type, Andreas Färber, 2012/08/01
- [Qemu-devel] [PATCH for-1.2 v5 13/14] pci: Derive PCI host bridges from TYPE_PCI_HOST_BRIDGE, Andreas Färber, 2012/08/01
- [Qemu-devel] [PATCH for-1.2 v5 14/14] pci: Tidy up PCI host bridges, Andreas Färber, 2012/08/01
- Re: [Qemu-devel] [PATCH for-1.2 v5 00/14] pci_host: Convert to QOM, Michael S. Tsirkin, 2012/08/02