qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]