qemu-e2k/hw/sd
Philippe Mathieu-Daudé 88d2198c08 hw/sd: Declare QOM types using DEFINE_TYPES() macro
When multiple QOM types are registered in the same file,
it is simpler to use the the DEFINE_TYPES() macro. In
particular because type array declared with such macro
are easier to review.

Mechanical transformation using the following comby script:

  [pattern-x1]
  match='''
  static const TypeInfo :[i1~.*_info] = {
      :[body]
  };
  static void :[rt1~.*_register_type.](void)
  {
      type_register_static(&:[i2~.*_info]);
  }
  type_init(:[rt2~.*_register_type.])
  '''
  rewrite='''
  static const TypeInfo :[i1][] = {
      {
      :[body]
      },
  };

  DEFINE_TYPES(:[i1])
  '''
  rule='where :[i1] == :[i2], :[rt1] == :[rt2]'

  [pattern-x2]
  match='''
  static const TypeInfo :[i1a~.*_info] = {
      :[body1]
  };
  ...
  static const TypeInfo :[i2a~.*_info] = {
      :[body2]
  };
  static void :[rt1~.*_register_type.](void)
  {
      type_register_static(&:[i1b~.*_info]);
      type_register_static(&:[i2b~.*_info]);
  }
  type_init(:[rt2~.*_register_type.])
  '''
  rewrite='''
  static const TypeInfo :[i1a][] = {
      {
      :[body1]
      },
      {
      :[body2]
      },
  };

  DEFINE_TYPES(:[i1a])
  '''
  rule='''
  where
  :[i1a] == :[i1b],
  :[i2a] == :[i2b],
  :[rt1] == :[rt2]
  '''

and re-indented manually.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20231031080603.86889-2-philmd@linaro.org>
2023-11-07 13:08:49 +01:00
..
allwinner-sdhost.c hw/sd/allwinner-sdhost: Don't send non-boolean IRQ line levels 2023-06-19 11:24:21 +01:00
aspeed_sdhci.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
bcm2835_sdhost.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
cadence_sdhci.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
core.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
Kconfig hw/sd: Add Cadence SDHCI emulation 2020-09-09 15:54:18 -07:00
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
npcm7xx_sdhci.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
omap_mmc.c hw/arm/omap: Drop useless casts from void * to pointer 2023-01-12 17:15:09 +00:00
pl181.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
pxa2xx_mmci.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
sd.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
sdhci-internal.h hw/sd/sdhci: Support big endian SD host controller interfaces 2022-12-21 14:17:55 -03:00
sdhci-pci.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
sdhci.c hw/sd/sdhci: Block Size Register bits [14:12] is lost 2023-10-19 23:13:27 +02:00
sdmmc-internal.c hw/sd: Add sd_cmd_SEND_OP_CMD() handler 2023-09-01 11:40:04 +02:00
sdmmc-internal.h
ssi-sd.c hw/sd: Declare QOM types using DEFINE_TYPES() macro 2023-11-07 13:08:49 +01:00
trace-events speed/sdhci: Add trace events 2021-10-22 09:52:17 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00