Correct and portable in theory, but triggers warnings with older gcc versions when -Wmissing-braces is enabled. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
Signed-off-by: Michael S. Tsirkin <m...@redhat.com> --- hw/i386/intel_iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 9bfa520..42396d0 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2089,7 +2089,7 @@ static int vtd_irte_get(IntelIOMMUState *iommu, uint16_t index, static int vtd_remap_irq_get(IntelIOMMUState *iommu, uint16_t index, VTDIrq *irq, uint16_t sid) { - VTD_IRTE irte = { 0 }; + VTD_IRTE irte = {}; int ret = 0; ret = vtd_irte_get(iommu, index, &irte, sid); @@ -2251,7 +2251,7 @@ static MemTxResult vtd_mem_ir_write(void *opaque, hwaddr addr, MemTxAttrs attrs) { int ret = 0; - MSIMessage from = {0}, to = {0}; + MSIMessage from = {}, to = {}; uint16_t sid = X86_IOMMU_SID_INVALID; from.address = (uint64_t) addr + VTD_INTERRUPT_ADDR_FIRST; -- MST