Skip to contentSkip to conversation

s390-pci: fix compilation on older GCC versions

PATCH Applied Paolo Bonzini 2 participants 2 messages Jan 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390-pci: fix compilation on older GCC versions

S390PCIBusDevice is typedef'ed earlier in the file, before the hunks that this patch modifies. The double typedef causes old versions of GCC to complain.

---
 hw/s390x/s390-pci-bus.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/s390x/s390-pci-bus.h +2 -2
index b0adefa..a25e926 100644
@@ -279,7 +279,7 @@ typedef struct S390PCIIOMMUTable {
     S390PCIIOMMU *iommu[PCI_SLOT_MAX];
 } S390PCIIOMMUTable;
 
-typedef struct S390PCIBusDevice {
+struct S390PCIBusDevice {
     DeviceState qdev;
     PCIDevice *pdev;
     ZpciState state;
@@ -301,7 +301,7 @@ typedef struct S390PCIBusDevice {
     IndAddr *indicator;
     QEMUTimer *release_timer;
     QTAILQ_ENTRY(S390PCIBusDevice) link;
-} S390PCIBusDevice;
+};
 
 typedef struct S390PCIBus {
     BusState qbus;
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 24 lines · Paolo Bonzini

S390PCIBusDevice is typedef'ed earlier in the file, before the hunks that this patch modifies. The double typedef causes old versions of GCC to complain.

---
 hw/s390x/s390-pci-bus.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/s390x/s390-pci-bus.h +1 -1
index b0adefa..a25e926 100644
@@ -279,7 +279,7 @@ typedef struct S390PCIIOMMUTable {
     S390PCIIOMMU *iommu[PCI_SLOT_MAX];
 } S390PCIIOMMUTable;
 
-typedef struct S390PCIBusDevice {
+struct S390PCIBusDevice {
     DeviceState qdev;
     PCIDevice *pdev;
     ZpciState state;

hw/s390x/s390-pci-bus.h typedef struct S390PCIBusDevice { · line 307

Quoted 8 lines
hw/s390x/s390-pci-bus.h +1 -1
@@ -301,7 +301,7 @@ typedef struct S390PCIBusDevice {
     IndAddr *indicator;
     QEMUTimer *release_timer;
     QTAILQ_ENTRY(S390PCIBusDevice) link;
-} S390PCIBusDevice;
+};
 
 typedef struct S390PCIBus {
     BusState qbus;

We cannot move this before S390PCIIOMMUTable due to the cross dependency and we need a forward declaration of the typedef, so yet this makes sense.

applied to our tree.