b21e238037
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> |
||
---|---|---|
.. | ||
a9gtimer.c | ||
allwinner-a10-pit.c | ||
altera_timer.c | ||
arm_mptimer.c | ||
arm_timer.c | ||
armv7m_systick.c | ||
aspeed_timer.c | ||
avr_timer16.c | ||
bcm2835_systmr.c | ||
cadence_ttc.c | ||
cmsdk-apb-dualtimer.c | ||
cmsdk-apb-timer.c | ||
digic-timer.c | ||
etraxfs_timer.c | ||
exynos4210_mct.c | ||
exynos4210_pwm.c | ||
grlib_gptimer.c | ||
hpet.c | ||
i8254_common.c | ||
i8254.c | ||
ibex_timer.c | ||
imx_epit.c | ||
imx_gpt.c | ||
Kconfig | ||
meson.build | ||
mips_gictimer.c | ||
mss-timer.c | ||
npcm7xx_timer.c | ||
nrf51_timer.c | ||
omap_gptimer.c | ||
omap_synctimer.c | ||
pxa2xx_timer.c | ||
renesas_cmt.c | ||
renesas_tmr.c | ||
sh_timer.c | ||
sifive_pwm.c | ||
slavio_timer.c | ||
sse-counter.c | ||
sse-timer.c | ||
stellaris-gptm.c | ||
stm32f2xx_timer.c | ||
trace-events | ||
trace.h | ||
xilinx_timer.c |