]> git.proxmox.com Git - mirror_qemu.git/commitdiff
pci: make sure pci_bus_is_express() won't error out with "discards ‘const’ qualifier"
authorIgor Mammedov <imammedo@redhat.com>
Thu, 12 Jan 2023 14:03:02 +0000 (15:03 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sat, 28 Jan 2023 11:21:29 +0000 (06:21 -0500)
function doesn't need RW aceess to passed in bus pointer,
make it const.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20230112140312.3096331-31-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci.c
include/hw/pci/pci.h

index 39a7bb32aa263dac2e095dcfc284cdd56d38e728..208c16f450a94bdd3e1a90129b145b9173585ec1 100644 (file)
@@ -483,7 +483,7 @@ static void pci_bus_uninit(PCIBus *bus)
     pci_host_bus_unregister(BUS(bus)->parent);
 }
 
-bool pci_bus_is_express(PCIBus *bus)
+bool pci_bus_is_express(const PCIBus *bus)
 {
     return object_dynamic_cast(OBJECT(bus), TYPE_PCIE_BUS);
 }
index 85ee458cd268972a807dacce8926f7c2e4cf8198..d5a40cd058a6e8c59477b70232ba13a9cf0b158e 100644 (file)
@@ -270,7 +270,7 @@ 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);
 
-bool pci_bus_is_express(PCIBus *bus);
+bool pci_bus_is_express(const PCIBus *bus);
 
 void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *parent,
                        const char *name,