[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/30] spapr/xive: Turn some sanity checks into assertions
From: |
David Gibson |
Subject: |
[PULL 01/30] spapr/xive: Turn some sanity checks into assertions |
Date: |
Fri, 11 Dec 2020 15:14:38 +1100 |
From: Greg Kurz <groug@kaod.org>
The sPAPR XIVE device is created by the machine in spapr_irq_init().
The latter overrides any value provided by the user with -global for
the "nr-irqs" and "nr-ends" properties with strictly positive values.
It seems reasonable to assume these properties should never be 0,
which wouldn't make much sense by the way.
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201120174646.619395-2-groug@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/intc/spapr_xive.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
index 1fa09f287a..60e0d5769d 100644
--- a/hw/intc/spapr_xive.c
+++ b/hw/intc/spapr_xive.c
@@ -296,22 +296,16 @@ static void spapr_xive_realize(DeviceState *dev, Error
**errp)
XiveENDSource *end_xsrc = &xive->end_source;
Error *local_err = NULL;
+ /* Set by spapr_irq_init() */
+ g_assert(xive->nr_irqs);
+ g_assert(xive->nr_ends);
+
sxc->parent_realize(dev, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
- if (!xive->nr_irqs) {
- error_setg(errp, "Number of interrupt needs to be greater 0");
- return;
- }
-
- if (!xive->nr_ends) {
- error_setg(errp, "Number of interrupt needs to be greater 0");
- return;
- }
-
/*
* Initialize the internal sources, for IPIs and virtual devices.
*/
--
2.29.2
- [PULL 00/30] ppc-for-6.0 queue 20201211, David Gibson, 2020/12/10
- [PULL 02/30] spapr/xics: Drop unused argument to xics_kvm_has_broken_disconnect(), David Gibson, 2020/12/10
- [PULL 03/30] spapr: Do PCI device hotplug sanity checks at pre-plug only, David Gibson, 2020/12/10
- [PULL 01/30] spapr/xive: Turn some sanity checks into assertions,
David Gibson <=
- [PULL 04/30] spapr: Do NVDIMM/PC-DIMM device hotplug sanity checks at pre-plug only, David Gibson, 2020/12/10
- [PULL 05/30] spapr: Make PHB placement functions and spapr_pre_plug_phb() return status, David Gibson, 2020/12/10
- [PULL 09/30] ppc: Add a missing break for PPC6xx_INPUT_TBEN, David Gibson, 2020/12/10
- [PULL 11/30] ppc/translate: Turn the helper macros into functions, David Gibson, 2020/12/10
- [PULL 07/30] spapr: Do TPM proxy hotplug sanity checks at pre-plug, David Gibson, 2020/12/10
- [PULL 06/30] spapr: Do PHB hoplug sanity check at pre-plug, David Gibson, 2020/12/10
- [PULL 15/30] hw/ppc/spapr_tpm_proxy: Fix hexadecimal format string specifier, David Gibson, 2020/12/10
- [PULL 16/30] xive: Add trace events, David Gibson, 2020/12/10
- [PULL 10/30] ppc/translate: Fix unordered f64/f128 comparisons, David Gibson, 2020/12/10
- [PULL 08/30] target/ppc: replaced the TODO with LOG_UNIMP and add break for silence warnings, David Gibson, 2020/12/10