qemu-patch-raspberry4/hw
Philippe Mathieu-Daudé 880a7817c1 misc: Replace zero-length arrays with flexible array member (manual)
Description copied from Linux kernel commit from Gustavo A. R. Silva
(see [3]):

--v-- description start --v--

  The current codebase makes use of the zero-length array language
  extension to the C90 standard, but the preferred mechanism to
  declare variable-length types such as these ones is a flexible
  array member [1], introduced in C99:

  struct foo {
      int stuff;
      struct boo array[];
  };

  By making use of the mechanism above, we will get a compiler
  warning in case the flexible array does not occur last in the
  structure, which will help us prevent some kind of undefined
  behavior bugs from being unadvertenly introduced [2] to the
  Linux codebase from now on.

--^-- description end --^--

Do the similar housekeeping in the QEMU codebase (which uses
C99 since commit 7be41675f7).

All these instances of code were found with the help of the
following command (then manual analysis, without modifying
structures only having a single flexible array member, such
QEDTable in block/qed.h):

  git grep -F '[0];'

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76497732932f
[3] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=17642a2fbd2c1

Inspired-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-03-16 22:07:42 +01:00
..
9pfs 9p/proxy: Fix export_flags 2020-03-10 16:12:49 +01:00
acpi misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
adc hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
alpha hw/alpha/dp264: Include "net/net.h" 2020-03-09 15:59:31 +01:00
arm hw/arm/virt: kvm: allow gicv3 by default if v2 cannot work 2020-03-12 16:27:33 +00:00
audio hw/audio/fmopl: Fix a typo twice 2020-03-09 15:59:31 +01:00
block qapi: Flatten object-add 2020-03-06 17:21:27 +01:00
char misc: Replace zero-length arrays with flexible array member (manual) 2020-03-16 22:07:42 +01:00
core core/qdev: fix memleak in qdev_get_gpio_out_connector() 2020-03-09 15:59:31 +01:00
cpu cpu/arm11mpcore: Set number of GIC priority bits to 4 2020-02-28 16:14:57 +00:00
cris hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
display stdvga+bochs-display: add dummy mmio handler 2020-03-16 12:40:47 +01:00
dma misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
gpio hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
hppa hw/hppa/machine: Include "net/net.h" 2020-03-09 15:59:31 +01:00
hyperv add device_legacy_reset function to prepare for reset api change 2020-01-30 16:02:03 +00:00
i2c hw/i2c/smbus_ich9: Include "qemu/range.h" 2020-03-09 15:59:31 +01:00
i386 misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
ide hw/ide: Let the DMAIntFunc prototype use a boolean 'is_write' argument 2020-02-20 14:47:08 +01:00
input hw/input: Do not enable CONFIG_PCKBD by default 2020-02-04 09:01:31 +01:00
intc hw/intc/armv7m_nvic: Rebuild hflags on reset 2020-03-12 16:01:37 +00:00
ipack qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ipmi qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
isa hw/southbridge/ich9: Removed unused headers 2020-03-09 15:59:31 +01:00
lm32 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
m68k misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
mem spapr: Add NVDIMM device support 2020-02-21 09:15:04 +11:00
microblaze hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
mips hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
misc misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
moxie hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
net hw/arm/allwinner-h3: add EMAC ethernet device 2020-03-12 16:27:33 +00:00
nios2 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
nubus hw/m68k: add Nubus support 2019-10-28 19:06:47 +01:00
nvram misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
openrisc hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
pci pcie_root_port: Add hotplug disabling option 2020-03-08 09:18:29 -04:00
pci-bridge pcie_root_port: Add hotplug disabling option 2020-03-08 09:18:29 -04:00
pci-host hw/pci-host/q35: Remove unused includes 2020-03-09 15:59:31 +01:00
pcmcia hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
ppc hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
rdma misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
riscv RISC-V Patches for the 5.0 Soft Freeze, Part 3 2020-03-03 11:06:39 +00:00
rtc hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00:00
s390x misc: Replace zero-length arrays with flexible array member (manual) 2020-03-16 22:07:42 +01:00
scsi scsi/scsi-disk: Remove redundant statement in scsi_disk_emulate_command() 2020-03-09 15:59:31 +01:00
sd hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
semihosting semihosting: add qemu_semihosting_console_inc for SYS_READC 2020-01-09 11:41:29 +00:00
sh4 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
smbios hw/smbios/smbios: Remove unused include 2020-02-06 10:38:57 +01:00
sparc hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
sparc64 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
ssi aspeed/smc: Fix User mode select/unselect scheme 2020-03-12 16:01:37 +00:00
timer hw/timer/hpet: Include "exec/address-spaces.h" 2020-03-09 15:59:31 +01:00
tpm tpm: Add the SysBus TPM TIS device 2020-03-05 12:18:08 -05:00
tricore hw: Do not initialize MachineClass::is_default to 0 2020-02-28 14:57:19 -05:00
unicore32 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
usb misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
vfio hw/vfio/display: Remove superfluous semicolon 2020-02-18 20:20:49 +01:00
virtio misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
watchdog qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
xen misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
xenpv trivial: Remove xenfb_enabled from sysemu.h 2020-02-04 09:00:57 +01:00
xtensa hw/xtensa/xtfpga:fix leak of fdevice tree blob 2020-02-19 10:33:38 +01:00
Kconfig Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
Makefile.objs Remove the core bluetooth code 2019-12-17 09:01:14 +01:00