Skip to contentSkip to conversation

ppc440_uc: Fix unintialized variable warning with older gcc

PATCH Applied BALATON Zoltan 2 participants 2 messages Mar 2, 2018 – Mar 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc440_uc: Fix unintialized variable warning with older gcc

---
 hw/ppc/ppc440_uc.c | 3 +++
 1 file changed, 3 insertions(+)
hw/ppc/ppc440_uc.c +3 -0
index 4e2523a..976ab2b 100644
@@ -1050,6 +1050,9 @@ static void ppc460ex_pcie_realize(DeviceState *dev, Error **errp)
     case DCRN_PCIE1_BASE:
         id = 1;
         break;
+    default:
+        error_setg(errp, "invalid PCIe DCRN base");
+        return;
     }
     snprintf(buf, sizeof(buf), "pcie%d-io", id);
     memory_region_init(&s->iomem, OBJECT(s), buf, UINT64_MAX);
Signature · 1 line
2.7.6
Applied
#1 lore raw
Quoted 1 line · BALATON Zoltan

Applied, and rebased so we don't get bisection breakage.

Quoted 18 lines
---
 hw/ppc/ppc440_uc.c | 3 +++
 1 file changed, 3 insertions(+)
hw/ppc/ppc440_uc.c +3 -0
index 4e2523a..976ab2b 100644
@@ -1050,6 +1050,9 @@ static void ppc460ex_pcie_realize(DeviceState *dev, Error **errp)
     case DCRN_PCIE1_BASE:
         id = 1;
         break;
+    default:
+        error_setg(errp, "invalid PCIe DCRN base");
+        return;
     }
     snprintf(buf, sizeof(buf), "pcie%d-io", id);
     memory_region_init(&s->iomem, OBJECT(s), buf, UINT64_MAX);
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson