qemu/hw
Markus Armbruster 1366244ab6 9pfs: 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).

Initial patch created mechanically with:

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

This uncovers a typing error:

    ../hw/9pfs/9p.c: In function ‘qid_path_fullmap’:
    ../hw/9pfs/9p.c:855:13: error: assignment to ‘QpfEntry *’ from incompatible pointer type ‘QppEntry *’ [-Werror=incompatible-pointer-types]
      855 |         val = g_new0(QppEntry, 1);
	  |             ^

Harmless, because QppEntry is larger than QpfEntry.  Manually fixed to
allocate a QpfEntry instead.

Cc: Greg Kurz <groug@kaod.org>
Cc: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <20220315144156.1595462-3-armbru@redhat.com>
2022-03-21 15:44:44 +01:00
..
9pfs 9pfs: Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
acpi hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table 2022-03-06 16:06:16 -05:00
adc
alpha
arm hw/arm/xlnx-zynqmp: Connect the ZynqMP APU Control 2022-03-18 11:31:20 +00:00
audio hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
avr
block aspeed queue: 2022-03-09 18:06:40 +00:00
char hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
core clock-vmstate: Add missing END_OF_LIST 2022-03-02 18:12:40 +00:00
cpu
cris
display hw/display/vga: Report a proper error when adding a 2nd ISA VGA 2022-03-18 10:15:57 +01:00
dma hw/dma/xlnx_csu_dma: Set TYPE_XLNX_CSU_DMA class_size 2022-03-18 10:55:15 +00:00
gpio hw: aspeed_gpio: Cleanup stray semicolon after switch 2022-03-08 09:18:11 +01:00
hppa hppa: Add support for an emulated TOC/NMI button. 2022-02-02 18:46:42 +01:00
hyperv
i2c hw/i2c: Added linear mode translation for pmbus devices 2022-03-08 18:46:48 +01:00
i386 hw/i386/acpi-build: Avoid 'sun' identifier 2022-03-18 11:32:13 +00:00
ide MIPS patches queue 2022-03-09 09:13:39 +00:00
input hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
intc hw/intc: Rename CONFIG_ARM_GIC_TCG into CONFIG_ARM_GICV3_TCG 2022-03-18 10:55:15 +00:00
ipack
ipmi hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
isa hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
m68k mos6522: implement edge-triggering for CA1/2 and CB1/2 control line IRQs 2022-03-09 09:28:28 +00:00
mem Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
microblaze
mips hw/mips/gt64xxx_pci: Resolve gt64120_register() 2022-03-08 19:38:13 +01:00
misc hw/misc: Add a model of the Xilinx ZynqMP APU Control 2022-03-18 11:31:20 +00:00
net virtio-net: fix map leaking on error during receive 2022-03-15 13:57:44 +08:00
nios2
nubus
nvme hw/nvme: 64-bit pi support 2022-03-03 09:30:21 +01:00
nvram hw/nvram: at24 return 0xff if 1 byte address 2022-03-14 14:48:35 +01:00
openrisc hw/openrisc/openrisc_sim: Add support for initrd loading 2022-02-26 10:39:36 +09:00
pci hw/pci/pci.c: Fix typos of "Firewire", and of "controller" on same line 2022-03-18 13:54:19 +01:00
pci-bridge pci: expose TYPE_XIO3130_DOWNSTREAM name 2022-03-06 05:08:23 -05:00
pci-host ppc/pnv: Remove user-created PHB{3,4,5} devices 2022-03-14 15:57:17 +01:00
pcmcia
ppc ppc/pnv: Remove user-created PHB{3,4,5} devices 2022-03-14 15:57:17 +01:00
rdma hw/dma: Use dma_addr_t type definition when relevant 2022-01-18 12:56:29 +01:00
remote hw/remote: Add missing include 2022-02-21 10:18:06 +01:00
riscv hw: riscv: opentitan: fixup SPI addresses 2022-03-03 13:14:50 +10:00
rtc hw/isa: Inline and remove one-line isa_init_irq() 2022-03-08 19:38:17 +01:00
rx
s390x s390x/cpumodel: Bump up QEMU model to a stripped-down IBM z15 GA1 2022-02-28 11:29:15 +01:00
scsi esp: recreate ESPState current_req after migration 2022-03-09 09:29:10 +00:00
sd Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
sensor hw/sensor: add Renesas raa228000 device 2022-03-08 18:46:48 +01:00
sh4
smbios hw/smbios: Add table 4 parameter, "processor-id" 2022-03-06 05:28:55 -05:00
sparc
sparc64
ssi aspeed/smc: Fix error log 2022-03-08 09:18:11 +01:00
timer hw/timer: fix a9gtimer vmstate 2022-02-21 13:30:21 +00:00
tpm MIPS patches queue 2022-03-09 09:13:39 +00:00
tricore
usb hw/usb/redirect.c: Stop using qemu_oom_check() 2022-03-04 11:20:16 +01:00
vfio kvm/msi: do explicit commit when adding msi routes 2022-03-15 11:26:20 +01:00
virtio virtio/virtio-balloon: Prefer Object* over void* parameter 2022-03-18 13:57:50 +01:00
watchdog
xen aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
xenpv
xtensa
Kconfig
meson.build