[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v1 14/25] arm: digic: Update error API usages
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [RFC PATCH v1 14/25] arm: digic: Update error API usages |
Date: |
Thu, 10 Sep 2015 22:33:24 -0700 |
Collect all errors and remove constant checking for realize failures.
Prefix errors and use error_report_err() as appropriate.
Cc: Antony Pavlov <address@hidden>
Cc: Peter Maydell <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
---
hw/arm/digic.c | 19 ++-----------------
hw/arm/digic_boards.c | 4 ++--
2 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/hw/arm/digic.c b/hw/arm/digic.c
index ec8c330..2632517 100644
--- a/hw/arm/digic.c
+++ b/hw/arm/digic.c
@@ -60,36 +60,21 @@ static void digic_realize(DeviceState *dev, Error **errp)
int i;
object_property_set_bool(OBJECT(&s->cpu), true, "reset-hivecs", &err);
- if (err != NULL) {
- error_propagate(errp, err);
- return;
- }
-
object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
- if (err != NULL) {
- error_propagate(errp, err);
- return;
- }
for (i = 0; i < DIGIC4_NB_TIMERS; i++) {
object_property_set_bool(OBJECT(&s->timer[i]), true, "realized", &err);
- if (err != NULL) {
- error_propagate(errp, err);
- return;
- }
sbd = SYS_BUS_DEVICE(&s->timer[i]);
sysbus_mmio_map(sbd, 0, DIGIC4_TIMER_BASE(i));
}
object_property_set_bool(OBJECT(&s->uart), true, "realized", &err);
- if (err != NULL) {
- error_propagate(errp, err);
- return;
- }
sbd = SYS_BUS_DEVICE(&s->uart);
sysbus_mmio_map(sbd, 0, DIGIC_UART_BASE);
+
+ error_propagate(errp, err);
}
static void digic_class_init(ObjectClass *oc, void *data)
diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index f8ba9e5..4256ece 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -64,8 +64,8 @@ static void digic4_board_init(DigicBoard *board)
s->digic = DIGIC(object_new(TYPE_DIGIC));
object_property_set_bool(OBJECT(s->digic), true, "realized", &err);
if (err != NULL) {
- error_report("Couldn't realize DIGIC SoC: %s",
- error_get_pretty(err));
+ error_prefix(err, "Couldn't realize DIGIC SoC: ");
+ error_report_err(err);
exit(1);
}
--
1.9.1
- [Qemu-devel] [RFC PATCH v1 04/25] error: Add support for multiple errors, (continued)
- [Qemu-devel] [RFC PATCH v1 04/25] error: Add support for multiple errors, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 05/25] error: Add error prefix API, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 07/25] sysbus: mmio_map+mmio_get_region: ignore range OOB errors, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 06/25] error: Add error_printf_fn(), Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 08/25] memory: nop APIs when they have NULL arguments, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 09/25] qdev: gpio: Ignore unconnectable GPIOs, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 10/25] arm: xlnx-zynqmp: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 12/25] arm: netduino: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 11/25] arm: fsl-imx*: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 13/25] arm: allwinner: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 14/25] arm: digic: Update error API usages,
Peter Crosthwaite <=
- [Qemu-devel] [RFC PATCH v1 15/25] cpu: arm: Remove un-needed error checking, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 16/25] ppc: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 17/25] i386: pc: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 18/25] monitor: update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 19/25] qdev: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 20/25] block: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 21/25] tests: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 22/25] usb: bus: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 23/25] scsi: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 24/25] migration: savevm: Update error API usages, Peter Crosthwaite, 2015/09/11