qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH] Mark remaining global TypeInfo instances as const


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] Mark remaining global TypeInfo instances as const
Date: Fri, 14 Jan 2022 12:02:48 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 13/1/22 18:10, Bernhard Beschow wrote:
More than 1k of TypeInfo instances are already marked as const. Mark the
remaining ones, too.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
  hw/core/generic-loader.c   | 2 +-
  hw/core/guest-loader.c     | 2 +-
  hw/display/bcm2835_fb.c    | 2 +-
  hw/display/i2c-ddc.c       | 2 +-
  hw/display/macfb.c         | 4 ++--
  hw/display/virtio-vga.c    | 2 +-
  hw/dma/bcm2835_dma.c       | 2 +-
  hw/i386/pc_piix.c          | 2 +-
  hw/i386/sgx-epc.c          | 2 +-
  hw/intc/bcm2835_ic.c       | 2 +-
  hw/intc/bcm2836_control.c  | 2 +-
  hw/ipmi/ipmi.c             | 4 ++--
  hw/mem/nvdimm.c            | 2 +-
  hw/mem/pc-dimm.c           | 2 +-
  hw/misc/bcm2835_mbox.c     | 2 +-
  hw/misc/bcm2835_powermgt.c | 2 +-
  hw/misc/bcm2835_property.c | 2 +-
  hw/misc/bcm2835_rng.c      | 2 +-
  hw/misc/pvpanic-isa.c      | 2 +-
  hw/misc/pvpanic-pci.c      | 2 +-
  hw/net/fsl_etsec/etsec.c   | 2 +-
  hw/ppc/prep_systemio.c     | 2 +-
  hw/ppc/spapr_iommu.c       | 2 +-
  hw/s390x/s390-pci-bus.c    | 2 +-
  hw/s390x/sclp.c            | 2 +-
  hw/s390x/tod-kvm.c         | 2 +-
  hw/s390x/tod-tcg.c         | 2 +-
  hw/s390x/tod.c             | 2 +-
  hw/scsi/lsi53c895a.c       | 2 +-
  hw/sd/allwinner-sdhost.c   | 2 +-
  hw/sd/aspeed_sdhci.c       | 2 +-
  hw/sd/bcm2835_sdhost.c     | 2 +-
  hw/sd/cadence_sdhci.c      | 2 +-
  hw/sd/npcm7xx_sdhci.c      | 2 +-
  hw/usb/dev-mtp.c           | 2 +-
  hw/usb/host-libusb.c       | 2 +-
  hw/vfio/igd.c              | 2 +-
  hw/virtio/virtio-pmem.c    | 2 +-
  qom/object.c               | 4 ++--
  39 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c
index 9a24ffb880..eaafc416f4 100644
--- a/hw/core/generic-loader.c
+++ b/hw/core/generic-loader.c
@@ -207,7 +207,7 @@ static void generic_loader_class_init(ObjectClass *klass, 
void *data)
      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
  }
-static TypeInfo generic_loader_info = {
+static const TypeInfo generic_loader_info = {

Good cleanup. If you use a sed expression to automatically replace,
it would be nice to mention it (see i.e. commit f548f20176cb5f4406).

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

To avoid further non-const static TypeInfo introduced, we should
add a check in scripts/checkpatch.pl. Maybe a simple "static TypeInfo"
line comparison is enough. Do you mind having a look for a patch?

Thanks,

Phil.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]