qemu-e2k/hw/misc
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
..
macio macio/pmu.c: remove redundant code 2022-03-09 09:28:28 +00:00
a9scu.c
allwinner-cpucfg.c
allwinner-h3-ccu.c
allwinner-h3-dramc.c
allwinner-h3-sysctrl.c
allwinner-sid.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
applesmc.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
arm11scu.c
arm_integrator_debug.c arm: Update infocenter.arm.com URLs 2021-02-11 11:50:14 +00:00
arm_l2x0.c
arm_sysctl.c
armsse-cpu-pwrctrl.c hw/misc/sse-cpu-pwrctrl: Implement SSE-300 CPU<N>_PWRCTRL register block 2021-03-08 17:20:02 +00:00
armsse-cpuid.c hw/arm/mps2: Update old infocenter.arm.com URLs 2021-03-08 11:54:16 +00:00
armsse-mhu.c hw/arm/mps2: Update old infocenter.arm.com URLs 2021-03-08 11:54:16 +00:00
armv7m_ras.c arm: Move M-profile RAS register block into its own device 2021-09-01 11:08:18 +01:00
aspeed_hace.c hw: Model ASPEED's Hash and Crypto Engine 2021-05-01 10:03:51 +02:00
aspeed_i3c.c hw/misc/aspeed_i3c.c: Introduce a dummy AST2600 I3C model. 2022-01-20 11:47:53 +00:00
aspeed_lpc.c hw/misc: Model KCS devices in the Aspeed LPC controller 2021-03-09 12:01:28 +01:00
aspeed_sbc.c ast2600: Add Secure Boot Controller model 2022-02-26 18:40:51 +01:00
aspeed_scu.c hw/arm/aspeed: Initialize AST2600 UART clock selection registers 2021-09-20 08:50:59 +02:00
aspeed_sdmc.c aspeed/sdmc: Add trace events 2022-02-26 18:40:51 +01:00
aspeed_xdma.c hw/misc/aspeed_xdma: Add AST2600 support 2021-05-01 10:03:52 +02:00
auxbus.c qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
avr_power.c
bcm2835_cprman.c clock: Add ClockEvent parameter to callbacks 2021-03-08 17:20:01 +00:00
bcm2835_mbox.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
bcm2835_mphi.c
bcm2835_powermgt.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
bcm2835_property.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
bcm2835_rng.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
bcm2835_thermal.c
cbus.c
debugexit.c
eccmemctl.c
edu.c
empty_slot.c
exynos4210_clk.c
exynos4210_pmu.c
exynos4210_rng.c
grlib_ahb_apb_pnp.c
imx6_ccm.c hw/msic: imx6_ccm: Correct register value for silicon type 2021-01-08 15:13:39 +00:00
imx6_src.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
imx6ul_ccm.c
imx7_ccm.c imx7-ccm: add digprog mmio write method 2021-02-08 15:15:32 +01:00
imx7_gpr.c
imx7_snvs.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
imx25_ccm.c
imx31_ccm.c
imx_ccm.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
imx_rngc.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
iotkit-secctl.c hw/misc/iotkit-secctl.c: Implement SSE-300 PID register values 2021-03-08 17:20:01 +00:00
iotkit-sysctl.c hw/misc/iotkit-sysctl: Implement SSE-200 and SSE-300 PID register values 2021-03-08 17:20:02 +00:00
iotkit-sysinfo.c hw/misc/iotkit-sysinfo.c: Implement SYS_CONFIG1 and IIDR 2021-03-08 17:20:01 +00:00
ivshmem.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
Kconfig sensor: Move hardware sensors from misc to a sensor directory 2021-06-17 07:10:32 -05:00
led.c hw: Do not include hw/irq.h if it is not necessary 2021-05-02 17:24:50 +02:00
mac_via.c mos6522: implement edge-triggering for CA1/2 and CB1/2 control line IRQs 2022-03-09 09:28:28 +00:00
mchp_pfsoc_dmc.c hw: Remove superfluous includes of hw/hw.h 2021-05-02 17:24:50 +02:00
mchp_pfsoc_ioscb.c hw: Remove superfluous includes of hw/hw.h 2021-05-02 17:24:50 +02:00
mchp_pfsoc_sysreg.c hw: Remove superfluous includes of hw/hw.h 2021-05-02 17:24:50 +02:00
meson.build hw/misc: Add a model of the Xilinx ZynqMP APU Control 2022-03-18 11:31:20 +00:00
mips_cmgcr.c
mips_cpc.c
mips_itu.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
mos6522.c mos6522: implement edge-triggering for CA1/2 and CB1/2 control line IRQs 2022-03-09 09:28:28 +00:00
mps2-fpgaio.c hw/misc/mps2-fpgaio: Support AN547 DBGCTRL register 2021-03-08 17:20:03 +00:00
mps2-scc.c hw/misc/mps2-scc: Support using CFG0 bit 0 for remapping 2021-05-10 17:21:54 +01:00
msf2-sysreg.c
mst_fpga.c hw/arm: Constify VMStateDescription 2021-05-02 17:24:50 +02:00
npcm7xx_clk.c hw/misc/npcm7xx_clk: Don't leak string in npcm7xx_clk_sel_init() 2022-03-18 10:55:15 +00:00
npcm7xx_gcr.c hw/*: Use type casting for SysBusDevice in NPCM7XX 2021-01-12 21:19:02 +00:00
npcm7xx_mft.c hw/misc: Add NPCM7XX MFT Module 2021-03-12 12:48:56 +00:00
npcm7xx_pwm.c hw/misc: Add GPIOs for duty in NPCM7xx PWM 2021-03-12 12:48:56 +00:00
npcm7xx_rng.c hw/*: Use type casting for SysBusDevice in NPCM7XX 2021-01-12 21:19:02 +00:00
nrf51_rng.c
omap_clk.c
omap_gpmc.c
omap_l4.c
omap_sdrc.c
omap_tap.c
pc-testdev.c
pca9552.c misc/pca9552: Fix LED status register indexing in pca955x_get_led() 2021-09-20 08:50:59 +02:00
pci-testdev.c
pvpanic-isa.c hw/misc/pvpanic: Use standard headers instead 2022-03-06 05:08:23 -05:00
pvpanic-pci.c hw/misc/pvpanic: Use standard headers instead 2022-03-06 05:08:23 -05:00
pvpanic.c hw/misc/pvpanic: Use standard headers instead 2022-03-06 05:08:23 -05:00
sbsa_ec.c Fix SPDX-License-Identifier typos 2021-02-20 12:36:19 +01:00
sga.c hw/misc: deprecate the 'sga' device 2021-11-02 17:24:18 +01:00
sifive_e_prci.c hw: Remove superfluous includes of hw/hw.h 2021-05-02 17:24:50 +02:00
sifive_test.c hw: Remove superfluous includes of hw/hw.h 2021-05-02 17:24:50 +02:00
sifive_u_otp.c hw: Replace trivial drive_get_next() by drive_get() 2021-12-15 08:38:16 +01:00
sifive_u_prci.c
slavio_misc.c
stm32f2xx_syscfg.c
stm32f4xx_exti.c
stm32f4xx_syscfg.c
trace-events mos6522: add register names to register read/write trace events 2022-03-09 09:28:28 +00:00
trace.h
tz-mpc.c
tz-msc.c
tz-ppc.c tz-ppc: add dummy read/write methods 2021-02-08 15:15:32 +01:00
unimp.c
virt_ctrl.c hw/m68k: Fix typo in SPDX tag 2021-11-09 10:11:27 +01:00
vmcoreinfo.c
xlnx-versal-pmc-iou-slcr.c hw/misc: Add a model of Versal's PMC SLCR 2022-01-28 14:29:46 +00:00
xlnx-versal-xramc.c hw/misc: versal: Add a model of the XRAM controller 2021-03-12 12:40:09 +00:00
xlnx-zynqmp-apu-ctrl.c hw/misc: Add a model of the Xilinx ZynqMP APU Control 2022-03-18 11:31:20 +00:00
xlnx-zynqmp-crf.c hw/misc: Add a model of the Xilinx ZynqMP CRF 2022-03-18 11:31:20 +00:00
zynq_slcr.c hw/misc: zynq_slcr: Correctly compute output clocks in the reset exit phase 2021-09-13 16:07:20 +01:00