On 3/9/25 12:09 AM, Philippe Mathieu-Daudé wrote: > Define TYPE_VFIO_PCI_IGD_LPC_BRIDGE once to help > following where the QOM type is used in the code. > We'll use it once more in the next commit. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx> Reviewed-by: Eric Auger <eric.auger@xxxxxxxxxx> Eric > --- > hw/vfio/pci-quirks.h | 2 ++ > hw/vfio/igd.c | 4 ++-- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/hw/vfio/pci-quirks.h b/hw/vfio/pci-quirks.h > index d1532e379b1..fdaa81f00aa 100644 > --- a/hw/vfio/pci-quirks.h > +++ b/hw/vfio/pci-quirks.h > @@ -69,4 +69,6 @@ typedef struct VFIOConfigMirrorQuirk { > > extern const MemoryRegionOps vfio_generic_mirror_quirk; > > +#define TYPE_VFIO_PCI_IGD_LPC_BRIDGE "vfio-pci-igd-lpc-bridge" > + > #endif /* HW_VFIO_VFIO_PCI_QUIRKS_H */ > diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c > index b1a237edd66..1fd3c4ef1d0 100644 > --- a/hw/vfio/igd.c > +++ b/hw/vfio/igd.c > @@ -262,7 +262,7 @@ static void vfio_pci_igd_lpc_bridge_class_init(ObjectClass *klass, void *data) > } > > static const TypeInfo vfio_pci_igd_lpc_bridge_info = { > - .name = "vfio-pci-igd-lpc-bridge", > + .name = TYPE_VFIO_PCI_IGD_LPC_BRIDGE, > .parent = TYPE_PCI_DEVICE, > .class_init = vfio_pci_igd_lpc_bridge_class_init, > .interfaces = (InterfaceInfo[]) { > @@ -524,7 +524,7 @@ void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr) > lpc_bridge = pci_find_device(pci_device_root_bus(&vdev->pdev), > 0, PCI_DEVFN(0x1f, 0)); > if (lpc_bridge && !object_dynamic_cast(OBJECT(lpc_bridge), > - "vfio-pci-igd-lpc-bridge")) { > + TYPE_VFIO_PCI_IGD_LPC_BRIDGE)) { > error_report("IGD device %s cannot support legacy mode due to existing " > "devices at address 1f.0", vdev->vbasedev.name); > return;