diff mbox

[1/4] machine: Use type_init() to register machine classes

Message ID 1455656347-29033-2-git-send-email-ehabkost@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eduardo Habkost Feb. 16, 2016, 8:59 p.m. UTC
Change all machine_init() users that simply call type_register*()
to use type_init().

Cc: Evgeny Voevodin <e.voevodin@samsung.com>
Cc: Maksim Kozlov <m.kozlov@samsung.com>
Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
Cc: Dmitry Solodkiy <d.solodkiy@samsung.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Michael Walle <michael@walle.cc>
Cc: "Hervé Poussineau" <hpoussin@reactos.org>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/arm/exynos4_boards.c | 2 +-
 hw/arm/gumstix.c        | 2 +-
 hw/arm/highbank.c       | 2 +-
 hw/arm/nseries.c        | 2 +-
 hw/arm/omap_sx1.c       | 2 +-
 hw/arm/realview.c       | 2 +-
 hw/arm/spitz.c          | 2 +-
 hw/arm/stellaris.c      | 2 +-
 hw/arm/versatilepb.c    | 2 +-
 hw/arm/vexpress.c       | 2 +-
 hw/arm/virt.c           | 2 +-
 hw/lm32/lm32_boards.c   | 2 +-
 hw/mips/mips_jazz.c     | 2 +-
 hw/ppc/ppc405_boards.c  | 2 +-
 hw/ppc/spapr.c          | 2 +-
 hw/sparc/sun4m.c        | 4 ----
 hw/sparc64/sun4u.c      | 4 ----
 hw/xtensa/xtfpga.c      | 2 +-
 include/hw/boards.h     | 2 +-
 include/hw/i386/pc.h    | 2 +-
 20 files changed, 18 insertions(+), 26 deletions(-)

Comments

Marcel Apfelbaum Feb. 17, 2016, 3:32 p.m. UTC | #1
On 02/16/2016 10:59 PM, Eduardo Habkost wrote:
> Change all machine_init() users that simply call type_register*()
> to use type_init().

If all machines are QOM objects this makes sense.

Acked-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

>
> Cc: Evgeny Voevodin <e.voevodin@samsung.com>
> Cc: Maksim Kozlov <m.kozlov@samsung.com>
> Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
> Cc: Dmitry Solodkiy <d.solodkiy@samsung.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Andrzej Zaborowski <balrogg@gmail.com>
> Cc: Michael Walle <michael@walle.cc>
> Cc: "Hervé Poussineau" <hpoussin@reactos.org>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Leon Alrae <leon.alrae@imgtec.com>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>   hw/arm/exynos4_boards.c | 2 +-
>   hw/arm/gumstix.c        | 2 +-
>   hw/arm/highbank.c       | 2 +-
>   hw/arm/nseries.c        | 2 +-
>   hw/arm/omap_sx1.c       | 2 +-
>   hw/arm/realview.c       | 2 +-
>   hw/arm/spitz.c          | 2 +-
>   hw/arm/stellaris.c      | 2 +-
>   hw/arm/versatilepb.c    | 2 +-
>   hw/arm/vexpress.c       | 2 +-
>   hw/arm/virt.c           | 2 +-
>   hw/lm32/lm32_boards.c   | 2 +-
>   hw/mips/mips_jazz.c     | 2 +-
>   hw/ppc/ppc405_boards.c  | 2 +-
>   hw/ppc/spapr.c          | 2 +-
>   hw/sparc/sun4m.c        | 4 ----
>   hw/sparc64/sun4u.c      | 4 ----
>   hw/xtensa/xtfpga.c      | 2 +-
>   include/hw/boards.h     | 2 +-
>   include/hw/i386/pc.h    | 2 +-
>   20 files changed, 18 insertions(+), 26 deletions(-)
>
> diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c
> index 42faa8c..5b11cd9 100644
> --- a/hw/arm/exynos4_boards.c
> +++ b/hw/arm/exynos4_boards.c
> @@ -181,4 +181,4 @@ static void exynos4_machines_init(void)
>       type_register_static(&smdkc210_type);
>   }
>
> -machine_init(exynos4_machines_init)
> +type_init(exynos4_machines_init)
> diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
> index 626d338..d59d9ba 100644
> --- a/hw/arm/gumstix.c
> +++ b/hw/arm/gumstix.c
> @@ -156,4 +156,4 @@ static void gumstix_machine_init(void)
>       type_register_static(&verdex_type);
>   }
>
> -machine_init(gumstix_machine_init)
> +type_init(gumstix_machine_init)
> diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
> index e25cf5e..e37378c 100644
> --- a/hw/arm/highbank.c
> +++ b/hw/arm/highbank.c
> @@ -437,4 +437,4 @@ static void calxeda_machines_init(void)
>       type_register_static(&midway_type);
>   }
>
> -machine_init(calxeda_machines_init)
> +type_init(calxeda_machines_init)
> diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
> index d9e61f7..9a5f33b 100644
> --- a/hw/arm/nseries.c
> +++ b/hw/arm/nseries.c
> @@ -1450,4 +1450,4 @@ static void nseries_machine_init(void)
>       type_register_static(&n810_type);
>   }
>
> -machine_init(nseries_machine_init)
> +type_init(nseries_machine_init)
> diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
> index 68236a3..cd50691 100644
> --- a/hw/arm/omap_sx1.c
> +++ b/hw/arm/omap_sx1.c
> @@ -252,4 +252,4 @@ static void sx1_machine_init(void)
>       type_register_static(&sx1_machine_v2_type);
>   }
>
> -machine_init(sx1_machine_init)
> +type_init(sx1_machine_init)
> diff --git a/hw/arm/realview.c b/hw/arm/realview.c
> index 90429fc..481ae00 100644
> --- a/hw/arm/realview.c
> +++ b/hw/arm/realview.c
> @@ -457,4 +457,4 @@ static void realview_machine_init(void)
>       type_register_static(&realview_pbx_a9_type);
>   }
>
> -machine_init(realview_machine_init)
> +type_init(realview_machine_init)
> diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
> index 607cb58..c3048f3 100644
> --- a/hw/arm/spitz.c
> +++ b/hw/arm/spitz.c
> @@ -1037,7 +1037,7 @@ static void spitz_machine_init(void)
>       type_register_static(&terrierpda_type);
>   }
>
> -machine_init(spitz_machine_init)
> +type_init(spitz_machine_init)
>
>   static bool is_version_0(void *opaque, int version_id)
>   {
> diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
> index de8dbb2..c3c72f1 100644
> --- a/hw/arm/stellaris.c
> +++ b/hw/arm/stellaris.c
> @@ -1420,7 +1420,7 @@ static void stellaris_machine_init(void)
>       type_register_static(&lm3s6965evb_type);
>   }
>
> -machine_init(stellaris_machine_init)
> +type_init(stellaris_machine_init)
>
>   static void stellaris_i2c_class_init(ObjectClass *klass, void *data)
>   {
> diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
> index d061f0f..5f7523e 100644
> --- a/hw/arm/versatilepb.c
> +++ b/hw/arm/versatilepb.c
> @@ -419,7 +419,7 @@ static void versatile_machine_init(void)
>       type_register_static(&versatileab_type);
>   }
>
> -machine_init(versatile_machine_init)
> +type_init(versatile_machine_init)
>
>   static void vpb_sic_class_init(ObjectClass *klass, void *data)
>   {
> diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
> index 3154aea..9eca64c 100644
> --- a/hw/arm/vexpress.c
> +++ b/hw/arm/vexpress.c
> @@ -798,4 +798,4 @@ static void vexpress_machine_init(void)
>       type_register_static(&vexpress_a15_info);
>   }
>
> -machine_init(vexpress_machine_init);
> +type_init(vexpress_machine_init);
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 44bbbea..69eef0b 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1315,4 +1315,4 @@ static void machvirt_machine_init(void)
>       type_register_static(&machvirt_info);
>   }
>
> -machine_init(machvirt_machine_init);
> +type_init(machvirt_machine_init);
> diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
> index efa6f91..8d67657 100644
> --- a/hw/lm32/lm32_boards.c
> +++ b/hw/lm32/lm32_boards.c
> @@ -329,4 +329,4 @@ static void lm32_machine_init(void)
>       type_register_static(&lm32_uclinux_type);
>   }
>
> -machine_init(lm32_machine_init)
> +type_init(lm32_machine_init)
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index d6d8058..4931cb1 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -387,4 +387,4 @@ static void mips_jazz_machine_init(void)
>       type_register_static(&mips_pica61_type);
>   }
>
> -machine_init(mips_jazz_machine_init)
> +type_init(mips_jazz_machine_init)
> diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
> index 6797808..d8db319 100644
> --- a/hw/ppc/ppc405_boards.c
> +++ b/hw/ppc/ppc405_boards.c
> @@ -658,4 +658,4 @@ static void ppc405_machine_init(void)
>       type_register_static(&taihu_type);
>   }
>
> -machine_init(ppc405_machine_init)
> +type_init(ppc405_machine_init)
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 5bd8fd3..8b3b584 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2370,7 +2370,7 @@ static const TypeInfo spapr_machine_info = {
>       {                                                                \
>           type_register(&spapr_machine_##suffix##_info);               \
>       }                                                                \
> -    machine_init(spapr_machine_register_##suffix)
> +    type_init(spapr_machine_register_##suffix)
>
>   /*
>    * pseries-2.6
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 20dc341..081dcdd 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -1553,10 +1553,7 @@ static void sun4m_register_types(void)
>       type_register_static(&afx_info);
>       type_register_static(&prom_info);
>       type_register_static(&ram_info);
> -}
>
> -static void sun4m_machine_init(void)
> -{
>       type_register_static(&ss5_type);
>       type_register_static(&ss10_type);
>       type_register_static(&ss600mp_type);
> @@ -1569,4 +1566,3 @@ static void sun4m_machine_init(void)
>   }
>
>   type_init(sun4m_register_types)
> -machine_init(sun4m_machine_init)
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index add1e75..5c4111d 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -997,14 +997,10 @@ static void sun4u_register_types(void)
>       type_register_static(&ebus_info);
>       type_register_static(&prom_info);
>       type_register_static(&ram_info);
> -}
>
> -static void sun4u_machine_init(void)
> -{
>       type_register_static(&sun4u_type);
>       type_register_static(&sun4v_type);
>       type_register_static(&niagara_type);
>   }
>
>   type_init(sun4u_register_types)
> -machine_init(sun4u_machine_init)
> diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
> index fe7684d..af353dc 100644
> --- a/hw/xtensa/xtfpga.c
> +++ b/hw/xtensa/xtfpga.c
> @@ -510,4 +510,4 @@ static void xtensa_lx_machines_init(void)
>       type_register_static(&xtensa_kc705_type);
>   }
>
> -machine_init(xtensa_lx_machines_init)
> +type_init(xtensa_lx_machines_init)
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 0f30959..2624420 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -155,7 +155,7 @@ struct MachineState {
>       { \
>           type_register_static(&machine_initfn##_typeinfo); \
>       } \
> -    machine_init(machine_initfn##_register_types)
> +    type_init(machine_initfn##_register_types)
>
>   #define SET_MACHINE_COMPAT(m, COMPAT) \
>       do {                              \
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 8b3546e..2d00002 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -852,7 +852,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
>       { \
>           type_register(&pc_machine_type_##suffix); \
>       } \
> -    machine_init(pc_machine_init_##suffix)
> +    type_init(pc_machine_init_##suffix)
>
>   extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
>   #endif
>
Michael S. Tsirkin Feb. 17, 2016, 3:57 p.m. UTC | #2
On Tue, Feb 16, 2016 at 06:59:04PM -0200, Eduardo Habkost wrote:
> Change all machine_init() users that simply call type_register*()
> to use type_init().
> 
> Cc: Evgeny Voevodin <e.voevodin@samsung.com>
> Cc: Maksim Kozlov <m.kozlov@samsung.com>
> Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
> Cc: Dmitry Solodkiy <d.solodkiy@samsung.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Andrzej Zaborowski <balrogg@gmail.com>
> Cc: Michael Walle <michael@walle.cc>
> Cc: "Hervé Poussineau" <hpoussin@reactos.org>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Leon Alrae <leon.alrae@imgtec.com>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

For pc:
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  hw/arm/exynos4_boards.c | 2 +-
>  hw/arm/gumstix.c        | 2 +-
>  hw/arm/highbank.c       | 2 +-
>  hw/arm/nseries.c        | 2 +-
>  hw/arm/omap_sx1.c       | 2 +-
>  hw/arm/realview.c       | 2 +-
>  hw/arm/spitz.c          | 2 +-
>  hw/arm/stellaris.c      | 2 +-
>  hw/arm/versatilepb.c    | 2 +-
>  hw/arm/vexpress.c       | 2 +-
>  hw/arm/virt.c           | 2 +-
>  hw/lm32/lm32_boards.c   | 2 +-
>  hw/mips/mips_jazz.c     | 2 +-
>  hw/ppc/ppc405_boards.c  | 2 +-
>  hw/ppc/spapr.c          | 2 +-
>  hw/sparc/sun4m.c        | 4 ----
>  hw/sparc64/sun4u.c      | 4 ----
>  hw/xtensa/xtfpga.c      | 2 +-
>  include/hw/boards.h     | 2 +-
>  include/hw/i386/pc.h    | 2 +-
>  20 files changed, 18 insertions(+), 26 deletions(-)
> 
> diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c
> index 42faa8c..5b11cd9 100644
> --- a/hw/arm/exynos4_boards.c
> +++ b/hw/arm/exynos4_boards.c
> @@ -181,4 +181,4 @@ static void exynos4_machines_init(void)
>      type_register_static(&smdkc210_type);
>  }
>  
> -machine_init(exynos4_machines_init)
> +type_init(exynos4_machines_init)
> diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
> index 626d338..d59d9ba 100644
> --- a/hw/arm/gumstix.c
> +++ b/hw/arm/gumstix.c
> @@ -156,4 +156,4 @@ static void gumstix_machine_init(void)
>      type_register_static(&verdex_type);
>  }
>  
> -machine_init(gumstix_machine_init)
> +type_init(gumstix_machine_init)
> diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
> index e25cf5e..e37378c 100644
> --- a/hw/arm/highbank.c
> +++ b/hw/arm/highbank.c
> @@ -437,4 +437,4 @@ static void calxeda_machines_init(void)
>      type_register_static(&midway_type);
>  }
>  
> -machine_init(calxeda_machines_init)
> +type_init(calxeda_machines_init)
> diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
> index d9e61f7..9a5f33b 100644
> --- a/hw/arm/nseries.c
> +++ b/hw/arm/nseries.c
> @@ -1450,4 +1450,4 @@ static void nseries_machine_init(void)
>      type_register_static(&n810_type);
>  }
>  
> -machine_init(nseries_machine_init)
> +type_init(nseries_machine_init)
> diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
> index 68236a3..cd50691 100644
> --- a/hw/arm/omap_sx1.c
> +++ b/hw/arm/omap_sx1.c
> @@ -252,4 +252,4 @@ static void sx1_machine_init(void)
>      type_register_static(&sx1_machine_v2_type);
>  }
>  
> -machine_init(sx1_machine_init)
> +type_init(sx1_machine_init)
> diff --git a/hw/arm/realview.c b/hw/arm/realview.c
> index 90429fc..481ae00 100644
> --- a/hw/arm/realview.c
> +++ b/hw/arm/realview.c
> @@ -457,4 +457,4 @@ static void realview_machine_init(void)
>      type_register_static(&realview_pbx_a9_type);
>  }
>  
> -machine_init(realview_machine_init)
> +type_init(realview_machine_init)
> diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
> index 607cb58..c3048f3 100644
> --- a/hw/arm/spitz.c
> +++ b/hw/arm/spitz.c
> @@ -1037,7 +1037,7 @@ static void spitz_machine_init(void)
>      type_register_static(&terrierpda_type);
>  }
>  
> -machine_init(spitz_machine_init)
> +type_init(spitz_machine_init)
>  
>  static bool is_version_0(void *opaque, int version_id)
>  {
> diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
> index de8dbb2..c3c72f1 100644
> --- a/hw/arm/stellaris.c
> +++ b/hw/arm/stellaris.c
> @@ -1420,7 +1420,7 @@ static void stellaris_machine_init(void)
>      type_register_static(&lm3s6965evb_type);
>  }
>  
> -machine_init(stellaris_machine_init)
> +type_init(stellaris_machine_init)
>  
>  static void stellaris_i2c_class_init(ObjectClass *klass, void *data)
>  {
> diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
> index d061f0f..5f7523e 100644
> --- a/hw/arm/versatilepb.c
> +++ b/hw/arm/versatilepb.c
> @@ -419,7 +419,7 @@ static void versatile_machine_init(void)
>      type_register_static(&versatileab_type);
>  }
>  
> -machine_init(versatile_machine_init)
> +type_init(versatile_machine_init)
>  
>  static void vpb_sic_class_init(ObjectClass *klass, void *data)
>  {
> diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
> index 3154aea..9eca64c 100644
> --- a/hw/arm/vexpress.c
> +++ b/hw/arm/vexpress.c
> @@ -798,4 +798,4 @@ static void vexpress_machine_init(void)
>      type_register_static(&vexpress_a15_info);
>  }
>  
> -machine_init(vexpress_machine_init);
> +type_init(vexpress_machine_init);
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 44bbbea..69eef0b 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1315,4 +1315,4 @@ static void machvirt_machine_init(void)
>      type_register_static(&machvirt_info);
>  }
>  
> -machine_init(machvirt_machine_init);
> +type_init(machvirt_machine_init);
> diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
> index efa6f91..8d67657 100644
> --- a/hw/lm32/lm32_boards.c
> +++ b/hw/lm32/lm32_boards.c
> @@ -329,4 +329,4 @@ static void lm32_machine_init(void)
>      type_register_static(&lm32_uclinux_type);
>  }
>  
> -machine_init(lm32_machine_init)
> +type_init(lm32_machine_init)
> diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
> index d6d8058..4931cb1 100644
> --- a/hw/mips/mips_jazz.c
> +++ b/hw/mips/mips_jazz.c
> @@ -387,4 +387,4 @@ static void mips_jazz_machine_init(void)
>      type_register_static(&mips_pica61_type);
>  }
>  
> -machine_init(mips_jazz_machine_init)
> +type_init(mips_jazz_machine_init)
> diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
> index 6797808..d8db319 100644
> --- a/hw/ppc/ppc405_boards.c
> +++ b/hw/ppc/ppc405_boards.c
> @@ -658,4 +658,4 @@ static void ppc405_machine_init(void)
>      type_register_static(&taihu_type);
>  }
>  
> -machine_init(ppc405_machine_init)
> +type_init(ppc405_machine_init)
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 5bd8fd3..8b3b584 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2370,7 +2370,7 @@ static const TypeInfo spapr_machine_info = {
>      {                                                                \
>          type_register(&spapr_machine_##suffix##_info);               \
>      }                                                                \
> -    machine_init(spapr_machine_register_##suffix)
> +    type_init(spapr_machine_register_##suffix)
>  
>  /*
>   * pseries-2.6
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 20dc341..081dcdd 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -1553,10 +1553,7 @@ static void sun4m_register_types(void)
>      type_register_static(&afx_info);
>      type_register_static(&prom_info);
>      type_register_static(&ram_info);
> -}
>  
> -static void sun4m_machine_init(void)
> -{
>      type_register_static(&ss5_type);
>      type_register_static(&ss10_type);
>      type_register_static(&ss600mp_type);
> @@ -1569,4 +1566,3 @@ static void sun4m_machine_init(void)
>  }
>  
>  type_init(sun4m_register_types)
> -machine_init(sun4m_machine_init)
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index add1e75..5c4111d 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -997,14 +997,10 @@ static void sun4u_register_types(void)
>      type_register_static(&ebus_info);
>      type_register_static(&prom_info);
>      type_register_static(&ram_info);
> -}
>  
> -static void sun4u_machine_init(void)
> -{
>      type_register_static(&sun4u_type);
>      type_register_static(&sun4v_type);
>      type_register_static(&niagara_type);
>  }
>  
>  type_init(sun4u_register_types)
> -machine_init(sun4u_machine_init)
> diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
> index fe7684d..af353dc 100644
> --- a/hw/xtensa/xtfpga.c
> +++ b/hw/xtensa/xtfpga.c
> @@ -510,4 +510,4 @@ static void xtensa_lx_machines_init(void)
>      type_register_static(&xtensa_kc705_type);
>  }
>  
> -machine_init(xtensa_lx_machines_init)
> +type_init(xtensa_lx_machines_init)
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 0f30959..2624420 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -155,7 +155,7 @@ struct MachineState {
>      { \
>          type_register_static(&machine_initfn##_typeinfo); \
>      } \
> -    machine_init(machine_initfn##_register_types)
> +    type_init(machine_initfn##_register_types)
>  
>  #define SET_MACHINE_COMPAT(m, COMPAT) \
>      do {                              \
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 8b3546e..2d00002 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -852,7 +852,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
>      { \
>          type_register(&pc_machine_type_##suffix); \
>      } \
> -    machine_init(pc_machine_init_##suffix)
> +    type_init(pc_machine_init_##suffix)
>  
>  extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
>  #endif
> -- 
> 2.1.0
David Gibson Feb. 18, 2016, 2:35 a.m. UTC | #3
On Tue, Feb 16, 2016 at 06:59:04PM -0200, Eduardo Habkost wrote:
> Change all machine_init() users that simply call type_register*()
> to use type_init().
> 
> Cc: Evgeny Voevodin <e.voevodin@samsung.com>
> Cc: Maksim Kozlov <m.kozlov@samsung.com>
> Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
> Cc: Dmitry Solodkiy <d.solodkiy@samsung.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Andrzej Zaborowski <balrogg@gmail.com>
> Cc: Michael Walle <michael@walle.cc>
> Cc: "Hervé Poussineau" <hpoussin@reactos.org>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Leon Alrae <leon.alrae@imgtec.com>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  hw/arm/exynos4_boards.c | 2 +-
>  hw/arm/gumstix.c        | 2 +-
>  hw/arm/highbank.c       | 2 +-
>  hw/arm/nseries.c        | 2 +-
>  hw/arm/omap_sx1.c       | 2 +-
>  hw/arm/realview.c       | 2 +-
>  hw/arm/spitz.c          | 2 +-
>  hw/arm/stellaris.c      | 2 +-
>  hw/arm/versatilepb.c    | 2 +-
>  hw/arm/vexpress.c       | 2 +-
>  hw/arm/virt.c           | 2 +-
>  hw/lm32/lm32_boards.c   | 2 +-
>  hw/mips/mips_jazz.c     | 2 +-
>  hw/ppc/ppc405_boards.c  | 2 +-
>  hw/ppc/spapr.c          | 2 +-
>  hw/sparc/sun4m.c        | 4 ----
>  hw/sparc64/sun4u.c      | 4 ----
>  hw/xtensa/xtfpga.c      | 2 +-
>  include/hw/boards.h     | 2 +-
>  include/hw/i386/pc.h    | 2 +-
>  20 files changed, 18 insertions(+), 26 deletions(-)

For spapr,

Acked-by: David Gibson <david@gibson.dropbear.id.au>
diff mbox

Patch

diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c
index 42faa8c..5b11cd9 100644
--- a/hw/arm/exynos4_boards.c
+++ b/hw/arm/exynos4_boards.c
@@ -181,4 +181,4 @@  static void exynos4_machines_init(void)
     type_register_static(&smdkc210_type);
 }
 
-machine_init(exynos4_machines_init)
+type_init(exynos4_machines_init)
diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
index 626d338..d59d9ba 100644
--- a/hw/arm/gumstix.c
+++ b/hw/arm/gumstix.c
@@ -156,4 +156,4 @@  static void gumstix_machine_init(void)
     type_register_static(&verdex_type);
 }
 
-machine_init(gumstix_machine_init)
+type_init(gumstix_machine_init)
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index e25cf5e..e37378c 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -437,4 +437,4 @@  static void calxeda_machines_init(void)
     type_register_static(&midway_type);
 }
 
-machine_init(calxeda_machines_init)
+type_init(calxeda_machines_init)
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index d9e61f7..9a5f33b 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -1450,4 +1450,4 @@  static void nseries_machine_init(void)
     type_register_static(&n810_type);
 }
 
-machine_init(nseries_machine_init)
+type_init(nseries_machine_init)
diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index 68236a3..cd50691 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -252,4 +252,4 @@  static void sx1_machine_init(void)
     type_register_static(&sx1_machine_v2_type);
 }
 
-machine_init(sx1_machine_init)
+type_init(sx1_machine_init)
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 90429fc..481ae00 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -457,4 +457,4 @@  static void realview_machine_init(void)
     type_register_static(&realview_pbx_a9_type);
 }
 
-machine_init(realview_machine_init)
+type_init(realview_machine_init)
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 607cb58..c3048f3 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -1037,7 +1037,7 @@  static void spitz_machine_init(void)
     type_register_static(&terrierpda_type);
 }
 
-machine_init(spitz_machine_init)
+type_init(spitz_machine_init)
 
 static bool is_version_0(void *opaque, int version_id)
 {
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index de8dbb2..c3c72f1 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -1420,7 +1420,7 @@  static void stellaris_machine_init(void)
     type_register_static(&lm3s6965evb_type);
 }
 
-machine_init(stellaris_machine_init)
+type_init(stellaris_machine_init)
 
 static void stellaris_i2c_class_init(ObjectClass *klass, void *data)
 {
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index d061f0f..5f7523e 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -419,7 +419,7 @@  static void versatile_machine_init(void)
     type_register_static(&versatileab_type);
 }
 
-machine_init(versatile_machine_init)
+type_init(versatile_machine_init)
 
 static void vpb_sic_class_init(ObjectClass *klass, void *data)
 {
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 3154aea..9eca64c 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -798,4 +798,4 @@  static void vexpress_machine_init(void)
     type_register_static(&vexpress_a15_info);
 }
 
-machine_init(vexpress_machine_init);
+type_init(vexpress_machine_init);
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 44bbbea..69eef0b 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1315,4 +1315,4 @@  static void machvirt_machine_init(void)
     type_register_static(&machvirt_info);
 }
 
-machine_init(machvirt_machine_init);
+type_init(machvirt_machine_init);
diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
index efa6f91..8d67657 100644
--- a/hw/lm32/lm32_boards.c
+++ b/hw/lm32/lm32_boards.c
@@ -329,4 +329,4 @@  static void lm32_machine_init(void)
     type_register_static(&lm32_uclinux_type);
 }
 
-machine_init(lm32_machine_init)
+type_init(lm32_machine_init)
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index d6d8058..4931cb1 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -387,4 +387,4 @@  static void mips_jazz_machine_init(void)
     type_register_static(&mips_pica61_type);
 }
 
-machine_init(mips_jazz_machine_init)
+type_init(mips_jazz_machine_init)
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 6797808..d8db319 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -658,4 +658,4 @@  static void ppc405_machine_init(void)
     type_register_static(&taihu_type);
 }
 
-machine_init(ppc405_machine_init)
+type_init(ppc405_machine_init)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 5bd8fd3..8b3b584 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2370,7 +2370,7 @@  static const TypeInfo spapr_machine_info = {
     {                                                                \
         type_register(&spapr_machine_##suffix##_info);               \
     }                                                                \
-    machine_init(spapr_machine_register_##suffix)
+    type_init(spapr_machine_register_##suffix)
 
 /*
  * pseries-2.6
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 20dc341..081dcdd 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -1553,10 +1553,7 @@  static void sun4m_register_types(void)
     type_register_static(&afx_info);
     type_register_static(&prom_info);
     type_register_static(&ram_info);
-}
 
-static void sun4m_machine_init(void)
-{
     type_register_static(&ss5_type);
     type_register_static(&ss10_type);
     type_register_static(&ss600mp_type);
@@ -1569,4 +1566,3 @@  static void sun4m_machine_init(void)
 }
 
 type_init(sun4m_register_types)
-machine_init(sun4m_machine_init)
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index add1e75..5c4111d 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -997,14 +997,10 @@  static void sun4u_register_types(void)
     type_register_static(&ebus_info);
     type_register_static(&prom_info);
     type_register_static(&ram_info);
-}
 
-static void sun4u_machine_init(void)
-{
     type_register_static(&sun4u_type);
     type_register_static(&sun4v_type);
     type_register_static(&niagara_type);
 }
 
 type_init(sun4u_register_types)
-machine_init(sun4u_machine_init)
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index fe7684d..af353dc 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -510,4 +510,4 @@  static void xtensa_lx_machines_init(void)
     type_register_static(&xtensa_kc705_type);
 }
 
-machine_init(xtensa_lx_machines_init)
+type_init(xtensa_lx_machines_init)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 0f30959..2624420 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -155,7 +155,7 @@  struct MachineState {
     { \
         type_register_static(&machine_initfn##_typeinfo); \
     } \
-    machine_init(machine_initfn##_register_types)
+    type_init(machine_initfn##_register_types)
 
 #define SET_MACHINE_COMPAT(m, COMPAT) \
     do {                              \
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 8b3546e..2d00002 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -852,7 +852,7 @@  bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
     { \
         type_register(&pc_machine_type_##suffix); \
     } \
-    machine_init(pc_machine_init_##suffix)
+    type_init(pc_machine_init_##suffix)
 
 extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
 #endif