[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 15/15] spapr: Simplify error handling in spapr_memory_unplug_requ
From: |
Greg Kurz |
Subject: |
[PATCH 15/15] spapr: Simplify error handling in spapr_memory_unplug_request() |
Date: |
Mon, 14 Sep 2020 14:35:05 +0200 |
Since object_property_get_uint() only returns 0 on failure, use
that instead of local_err, and get rid of the error propagation
overhead.
Signed-off-by: Greg Kurz <groug@kaod.org>
---
hw/ppc/spapr.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d6b4de6a1c53..2eca9dc26668 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3609,7 +3609,6 @@ static void spapr_memory_unplug_request(HotplugHandler
*hotplug_dev,
DeviceState *dev, Error **errp)
{
SpaprMachineState *spapr = SPAPR_MACHINE(hotplug_dev);
- Error *local_err = NULL;
PCDIMMDevice *dimm = PC_DIMM(dev);
uint32_t nr_lmbs;
uint64_t size, addr_start, addr;
@@ -3625,9 +3624,8 @@ static void spapr_memory_unplug_request(HotplugHandler
*hotplug_dev,
nr_lmbs = size / SPAPR_MEMORY_BLOCK_SIZE;
addr_start = object_property_get_uint(OBJECT(dimm), PC_DIMM_ADDR_PROP,
- &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
+ errp);
+ if (!addr_start) {
return;
}
--
2.26.2
- Re: [SPAM] Re: [PATCH 14/15] spapr: Simplify error handling in spapr_memory_plug(), (continued)
- Re: [SPAM] Re: [PATCH 14/15] spapr: Simplify error handling in spapr_memory_plug(), David Gibson, 2020/09/16
- Re: [SPAM] Re: [PATCH 14/15] spapr: Simplify error handling in spapr_memory_plug(), Markus Armbruster, 2020/09/17
- Re: [PATCH 14/15] spapr: Simplify error handling in spapr_memory_plug(), Greg Kurz, 2020/09/17
- Re: [PATCH 14/15] spapr: Simplify error handling in spapr_memory_plug(), Markus Armbruster, 2020/09/17
- Re: [PATCH 14/15] spapr: Simplify error handling in spapr_memory_plug(), Daniel P . Berrangé, 2020/09/17
- Re: [PATCH 14/15] spapr: Simplify error handling in spapr_memory_plug(), Greg Kurz, 2020/09/17
- Re: [PATCH 14/15] spapr: Simplify error handling in spapr_memory_plug(), Markus Armbruster, 2020/09/17
[PATCH 15/15] spapr: Simplify error handling in spapr_memory_unplug_request(),
Greg Kurz <=
[PATCH 11/15] spapr: Simplify error handling in spapr_cpu_core_realize(), Greg Kurz, 2020/09/14
Re: [PATCH 00/15] spapr: Error handling fixes and cleanups (round 2), David Gibson, 2020/09/16