[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/8] pci: Define pci_bus_fn/pci_bus_ret_fn type
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 4/8] pci: Define pci_bus_fn/pci_bus_ret_fn type |
Date: |
Thu, 21 Oct 2021 13:44:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 |
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 <peterx@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é <philmd@redhat.com>