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

Re: [PATCH 29/71] hw/i386: Constify all Property


  • To: Richard Henderson <richard.henderson@xxxxxxxxxx>, "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>
  • From: CLEMENT MATHIEU--DRIF <clement.mathieu--drif@xxxxxxxxxx>
  • Date: Mon, 16 Dec 2024 06:14:16 +0000
  • Accept-language: en-GB, fr-FR, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=eviden.com; dmarc=pass action=none header.from=eviden.com; dkim=pass header.d=eviden.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KcM3qu6wrUbpXxioCKYw1IyCE3cff/1SziVQFXEGa5M=; b=JIELYCoVVU36JaYfN+bH/c5rytv79Z7/gUya8yDYf9gC0bNuW2GwUNf9xP4utpDXRgzO6uHQeE0/uT8rky6ikan+289xdVJpsqdUdF/yyLc7wwMXgNvrAb9TaN3QRusUlGnTXSKKU4YSYI4XoGdQ/6qhtQpTs+4pTjdSu0mObsApQZ2IJ7dghAwEcBX2nkQUcSvGiWSZT6wbEUqwpmcNrmpYMdCHdYJ3fTz9HqU3bSWOPV32a24Dzl2zwH3WKScA3sIuS2BdPMDZex32BrD46eVMRrYn5OLe1hUCi1XXhuK+lkHPcK2E3gwUTJODZoADHa455zlOz4OiS97zPzj/kg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fINMuMroT7fBB7t16IQxx6w9fRrZbNSKpidTDbyVcKcBBIHloKhbuB1NWVuKGOCpoe0L3LqhYzw6Zmeyy9SR5JncHFqTR/3ZLzKUK/MLaSbi5SYD9cmNoR73pbdoJQT3e0rh6PhEWV1MEfT+6+b0EM6XF2sNrt3Q2YzEMZCcSM5qeXfNv7GNRLuHkuFMom55A4qOoYUjFd+haoymg4yBS7AMxBAVnsJqNnpRlBctfLEXFTtZzcvYxx05sLm/RyIvc+3V6DqUkyPz0xbCm/uf8Vg94IemfaS7Z/bTIHPOzB6YvQmAJm/tCD+UrRJ0/tl+f26nwMmQ2ilmKiXcGz3AFQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=eviden.com;
  • Cc: "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, Yi Liu <yi.l.liu@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, "open list:X86 Xen CPUs" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 16 Dec 2024 07:03:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbTZKuMX5TQ4/Qd0KDE8iIYBLMC7LoaEWA
  • Thread-topic: [PATCH 29/71] hw/i386: Constify all Property

Hi Rihard.

Good idea, LGTM.

Just out of curiosity, what was the motivation for such a patch?
It it simply about cleaning the code or is it intended to solve a deeper 
problem.

Thanks,
cmd


On 13/12/2024 20:07, Richard Henderson wrote:
> Caution: External email. Do not open attachments or click links, unless this 
> email comes from a known sender and you know the content is safe.
>
>
> Signed-off-by: Richard Henderson <richard.henderson@xxxxxxxxxx>
> ---
>   hw/i386/amd_iommu.c        | 2 +-
>   hw/i386/intel_iommu.c      | 2 +-
>   hw/i386/kvm/clock.c        | 2 +-
>   hw/i386/kvm/i8254.c        | 2 +-
>   hw/i386/kvm/ioapic.c       | 2 +-
>   hw/i386/sgx-epc.c          | 2 +-
>   hw/i386/vmmouse.c          | 2 +-
>   hw/i386/vmport.c           | 2 +-
>   hw/i386/x86-iommu.c        | 2 +-
>   hw/i386/xen/xen_pvdevice.c | 2 +-
>   10 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index af0f4da1f6..ca3e62a244 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -1668,7 +1668,7 @@ static void amdvi_sysbus_realize(DeviceState *dev, 
> Error **errp)
>       amdvi_init(s);
>   }
>
> -static Property amdvi_properties[] = {
> +static const Property amdvi_properties[] = {
>       DEFINE_PROP_BOOL("xtsup", AMDVIState, xtsup, false),
>       DEFINE_PROP_END_OF_LIST(),
>   };
> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> index 4c0d1d7d47..a5b268342f 100644
> --- a/hw/i386/intel_iommu.c
> +++ b/hw/i386/intel_iommu.c
> @@ -3404,7 +3404,7 @@ static const MemoryRegionOps vtd_mem_ops = {
>       },
>   };
>
> -static Property vtd_properties[] = {
> +static const Property vtd_properties[] = {
>       DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),
>       DEFINE_PROP_ON_OFF_AUTO("eim", IntelIOMMUState, intr_eim,
>                               ON_OFF_AUTO_AUTO),
> diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c
> index 40aa9a32c3..71150ed2e0 100644
> --- a/hw/i386/kvm/clock.c
> +++ b/hw/i386/kvm/clock.c
> @@ -305,7 +305,7 @@ static const VMStateDescription kvmclock_vmsd = {
>       }
>   };
>
> -static Property kvmclock_properties[] = {
> +static const Property kvmclock_properties[] = {
>       DEFINE_PROP_BOOL("x-mach-use-reliable-get-clock", KVMClockState,
>                         mach_use_reliable_get_clock, true),
>       DEFINE_PROP_END_OF_LIST(),
> diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c
> index baa4b39582..2933d3f458 100644
> --- a/hw/i386/kvm/i8254.c
> +++ b/hw/i386/kvm/i8254.c
> @@ -287,7 +287,7 @@ static void kvm_pit_realizefn(DeviceState *dev, Error 
> **errp)
>       kpc->parent_realize(dev, errp);
>   }
>
> -static Property kvm_pit_properties[] = {
> +static const Property kvm_pit_properties[] = {
>       DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", KVMPITState,
>                                  lost_tick_policy, LOST_TICK_POLICY_DELAY),
>       DEFINE_PROP_END_OF_LIST(),
> diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
> index 2907b08164..217ff43b98 100644
> --- a/hw/i386/kvm/ioapic.c
> +++ b/hw/i386/kvm/ioapic.c
> @@ -133,7 +133,7 @@ static void kvm_ioapic_realize(DeviceState *dev, Error 
> **errp)
>       qdev_init_gpio_in(dev, kvm_ioapic_set_irq, IOAPIC_NUM_PINS);
>   }
>
> -static Property kvm_ioapic_properties[] = {
> +static const Property kvm_ioapic_properties[] = {
>       DEFINE_PROP_UINT32("gsi_base", KVMIOAPICState, kvm_gsi_base, 0),
>       DEFINE_PROP_END_OF_LIST()
>   };
> diff --git a/hw/i386/sgx-epc.c b/hw/i386/sgx-epc.c
> index d664829d35..c232e825e0 100644
> --- a/hw/i386/sgx-epc.c
> +++ b/hw/i386/sgx-epc.c
> @@ -19,7 +19,7 @@
>   #include "target/i386/cpu.h"
>   #include "exec/address-spaces.h"
>
> -static Property sgx_epc_properties[] = {
> +static const Property sgx_epc_properties[] = {
>       DEFINE_PROP_UINT64(SGX_EPC_ADDR_PROP, SGXEPCDevice, addr, 0),
>       DEFINE_PROP_UINT32(SGX_EPC_NUMA_NODE_PROP, SGXEPCDevice, node, 0),
>       DEFINE_PROP_LINK(SGX_EPC_MEMDEV_PROP, SGXEPCDevice, hostmem,
> diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c
> index 76130cd46d..da9c35c1ec 100644
> --- a/hw/i386/vmmouse.c
> +++ b/hw/i386/vmmouse.c
> @@ -317,7 +317,7 @@ static void vmmouse_realizefn(DeviceState *dev, Error 
> **errp)
>       vmport_register(VMPORT_CMD_VMMOUSE_DATA, vmmouse_ioport_read, s);
>   }
>
> -static Property vmmouse_properties[] = {
> +static const Property vmmouse_properties[] = {
>       DEFINE_PROP_LINK("i8042", VMMouseState, i8042, TYPE_I8042, ISAKBDState 
> *),
>       DEFINE_PROP_END_OF_LIST(),
>   };
> diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
> index 7cc75dbc6d..cab6e72089 100644
> --- a/hw/i386/vmport.c
> +++ b/hw/i386/vmport.c
> @@ -252,7 +252,7 @@ static void vmport_realizefn(DeviceState *dev, Error 
> **errp)
>       }
>   }
>
> -static Property vmport_properties[] = {
> +static const Property vmport_properties[] = {
>       /* Used to enforce compatibility for migration */
>       DEFINE_PROP_BIT("x-read-set-eax", VMPortState, compat_flags,
>                       VMPORT_COMPAT_READ_SET_EAX_BIT, true),
> diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c
> index 60af896225..155f6262ea 100644
> --- a/hw/i386/x86-iommu.c
> +++ b/hw/i386/x86-iommu.c
> @@ -125,7 +125,7 @@ static void x86_iommu_realize(DeviceState *dev, Error 
> **errp)
>       }
>   }
>
> -static Property x86_iommu_properties[] = {
> +static const Property x86_iommu_properties[] = {
>       DEFINE_PROP_ON_OFF_AUTO("intremap", X86IOMMUState,
>                               intr_supported, ON_OFF_AUTO_AUTO),
>       DEFINE_PROP_BOOL("device-iotlb", X86IOMMUState, dt_supported, false),
> diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
> index ed621531d8..e71483e6e3 100644
> --- a/hw/i386/xen/xen_pvdevice.c
> +++ b/hw/i386/xen/xen_pvdevice.c
> @@ -115,7 +115,7 @@ static void xen_pv_realize(PCIDevice *pci_dev, Error 
> **errp)
>                        &d->mmio);
>   }
>
> -static Property xen_pv_props[] = {
> +static const Property xen_pv_props[] = {
>       DEFINE_PROP_UINT16("vendor-id", XenPVDevice, vendor_id, 
> PCI_VENDOR_ID_XEN),
>       DEFINE_PROP_UINT16("device-id", XenPVDevice, device_id, 0xffff),
>       DEFINE_PROP_UINT8("revision", XenPVDevice, revision, 0x01),
> --
> 2.43.0
>

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.