On 10/21/21 12:42, Peter Xu wrote: > The pci_bus_fn is similar to pci_bus_dev_fn that only takes a PCIBus* and an > opaque. The pci_bus_ret_fn is similar to pci_bus_fn but it allows to return a > void* pointer. > > Use them where proper in pci.[ch], and to be used elsewhere. > > Signed-off-by: Peter Xu <pet...@redhat.com> > --- > hw/pci/pci.c | 6 ++---- > include/hw/pci/pci.h | 12 +++++------- > 2 files changed, 7 insertions(+), 11 deletions(-)
> --- a/include/hw/pci/pci.h > +++ b/include/hw/pci/pci.h > @@ -402,6 +402,8 @@ OBJECT_DECLARE_TYPE(PCIBus, PCIBusClass, PCI_BUS) > #define TYPE_PCIE_BUS "PCIE" > > typedef void (*pci_bus_dev_fn)(PCIBus *b, PCIDevice *d, void *opaque); > +typedef void (*pci_bus_fn)(PCIBus *b, void *opaque); > +typedef void* (*pci_bus_ret_fn)(PCIBus *b, void *opaque); $ git grep -F '* (*'|wc -l 12 $ git grep -F ' *(*'|wc -l 88 Nitpicking but I'd rather follow the project typedef style, otherwise: Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com>