diff mbox

ppc440_uc: Fix unintialized variable warning with older gcc

Message ID 20180302214826.1671E7456D8@zero.eik.bme.hu (mailing list archive)
State New, archived
Headers show

Commit Message

BALATON Zoltan March 2, 2018, 9:43 p.m. UTC
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 hw/ppc/ppc440_uc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

David Gibson March 5, 2018, 1:27 a.m. UTC | #1
On Fri, Mar 02, 2018 at 10:43:23PM +0100, BALATON Zoltan wrote:
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>

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

> ---
>  hw/ppc/ppc440_uc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c
> index 4e2523a..976ab2b 100644
> --- a/hw/ppc/ppc440_uc.c
> +++ b/hw/ppc/ppc440_uc.c
> @@ -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);
diff mbox

Patch

diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c
index 4e2523a..976ab2b 100644
--- a/hw/ppc/ppc440_uc.c
+++ b/hw/ppc/ppc440_uc.c
@@ -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);