qemu-e2k/hw/ppc
Markus Armbruster b21e238037 Use g_new() & friends where that makes obvious sense
g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
for two reasons.  One, it catches multiplication overflowing size_t.
Two, it returns T * rather than void *, which lets the compiler catch
more type errors.

This commit only touches allocations with size arguments of the form
sizeof(T).

Patch created mechanically with:

    $ spatch --in-place --sp-file scripts/coccinelle/use-g_new-etc.cocci \
	     --macro-file scripts/cocci-macro-file.h FILES...

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20220315144156.1595462-4-armbru@redhat.com>
Reviewed-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
2022-03-21 15:44:44 +01:00
..
e500-ccsr.h
e500.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
e500.h
e500plat.c
fdt.c
fw_cfg.c
Kconfig
mac_newworld.c hw/ppc/mac.h: Remove MAX_CPUS macro 2021-12-17 17:57:12 +01:00
mac_oldworld.c hw/ppc/mac.h: Remove MAX_CPUS macro 2021-12-17 17:57:12 +01:00
mac.h hw/ppc/mac.h: Remove MAX_CPUS macro 2021-12-17 17:57:12 +01:00
meson.build
mpc8544_guts.c ppc/ppc4xx: Convert printfs() 2022-01-04 07:55:34 +01:00
mpc8544ds.c
pef.c
pegasos2.c target/ppc: Introduce a vhyp framework for nested HV support 2022-02-18 08:34:14 +01:00
pnv_bmc.c
pnv_core.c
pnv_homer.c ppc/pnv: Add a HOMER model to POWER10 2022-03-02 06:51:39 +01:00
pnv_lpc.c
pnv_occ.c ppc/pnv: Add a OCC model for POWER10 2022-03-02 06:51:39 +01:00
pnv_pnor.c ppc/pnv: Fix check on block device before updating drive contents 2021-11-09 10:32:52 +11:00
pnv_psi.c ppc/xive: Add support for PQ state bits offload 2022-03-02 06:51:39 +01:00
pnv_xscom.c
pnv.c ppc/pnv: Remove user-created PHB{3,4,5} devices 2022-03-14 15:57:17 +01:00
ppc4xx_devs.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
ppc4xx_pci.c ppc/ppc4xx: Convert printfs() 2022-01-04 07:55:34 +01:00
ppc405_boards.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
ppc405_uc.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
ppc405.h ppc/ppc405: Fix bi_pci_enetaddr2 field in U-Boot board information 2021-12-17 17:57:17 +01:00
ppc440_bamboo.c
ppc440_pcix.c
ppc440_uc.c
ppc440.h
ppc_booke.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
ppc.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
ppce500_spin.c
prep_systemio.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
prep.c target/ppc: Remove PowerPC 601 CPUs 2022-02-09 09:08:55 +01:00
rs6000_mc.c
sam460ex.c
spapr_caps.c hw/ppc/spapr_caps.c: use g_autofree in spapr_caps_add_properties() 2022-03-02 06:51:39 +01:00
spapr_cpu_core.c spapr: prevent hdec timer being set up under virtual hypervisor 2022-02-18 08:34:14 +01:00
spapr_drc.c hw/ppc/spapr_drc.c: use g_autofree in spapr_drc_by_index() 2022-03-02 06:51:40 +01:00
spapr_events.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
spapr_hcall.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
spapr_iommu.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
spapr_irq.c
spapr_numa.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
spapr_nvdimm.c spapr: nvdimm: Introduce spapr-nvdimm device 2022-02-18 08:34:14 +01:00
spapr_ovec.c
spapr_pci_nvlink2.c spapr_pci_nvlink2.c: use g_autofree in spapr_phb_nvgpu_ram_populate_dt() 2022-03-02 06:51:40 +01:00
spapr_pci_vfio.c pci: Export pci_for_each_device_under_bus*() 2021-11-01 19:36:11 -04:00
spapr_pci.c pci: Export pci_for_each_device_under_bus*() 2021-11-01 19:36:11 -04:00
spapr_rng.c
spapr_rtas_ddw.c
spapr_rtas.c hw/ppc/spapr_rtas.c: use g_autofree in rtas_ibm_get_system_parameter() 2022-03-02 06:51:40 +01:00
spapr_rtc.c rtc: Have event RTC_CHANGE identify the RTC by QOM path 2022-02-28 11:39:35 +01:00
spapr_softmmu.c osdep: Move memalign-related functions to their own header 2022-03-07 13:16:49 +00:00
spapr_tpm_proxy.c
spapr_vio.c hw/ppc/spapr_vio.c: use g_autofree in spapr_dt_vdevice() 2022-03-02 06:51:40 +01:00
spapr_vof.c spapr: Force 32bit when resetting a core 2022-01-28 13:15:01 +01:00
spapr.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
trace-events ppc/ppc405: Restore TCR and STR write handlers 2022-01-04 07:55:34 +01:00
trace.h
virtex_ml507.c
vof.c hw/ppc/vof: Add missing includes 2022-01-28 13:15:03 +01:00