qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 3/5] PCI: Convert pci_info() to QObject


From: Luiz Capitulino
Subject: [Qemu-devel] Re: [PATCH 3/5] PCI: Convert pci_info() to QObject
Date: Thu, 7 Jan 2010 16:00:29 -0200

On Thu, 07 Jan 2010 09:19:28 -0600
Anthony Liguori <address@hidden> wrote:

> > -static void pci_info_device(PCIBus *bus, PCIDevice *d)
> > +static void pci_for_each_device_under_bus(PCIBus *bus,
> > +                                          void (*fn)(PCIBus *b, PCIDevice 
> > *d))
> >   {
> > -    Monitor *mon = cur_mon;
> > -    int i, class;
> > -    PCIIORegion *r;
> > -    const pci_class_desc *desc;
> > +    PCIDevice *d;
> > +    int devfn;
> >
> > -    monitor_printf(mon, "  Bus %2d, device %3d, function %d:\n",
> > -                   pci_bus_num(d->bus),
> > -                   PCI_SLOT(d->devfn), PCI_FUNC(d->devfn));
> > -    class = pci_get_word(d->config + PCI_CLASS_DEVICE);
> > +    for(devfn = 0; devfn<  ARRAY_SIZE(bus->devices); devfn++) {
> > +        d = bus->devices[devfn];
> > +        if (d)
> > +            fn(bus, d);
> > +    }
> > +}
> >    
> 
> Coding style is off.  You're missing braces on the if.

 Was based on the current code, will fix.

> The conversion otherwise looks good.  I'm not sure mem_type_64 is the 
> best property name but I'll let mst comment on that.  I'd also prefer we 
> didn't mix case with BAR and IRQ.  I'd rather see us just use bar and irq.

 Ok, will fix too.




reply via email to

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