From 6c37ebf3301ca449ebe449138b86e55762503250 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 21 Nov 2022 09:50:45 +0100 Subject: error: Drop some obviously superfluous error_propagate() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When error_propagate(errp, local_err) is the only reader of @local_err, we can just as well change its writers to write @errp directly, and drop the error_propagate() along with @local_err. Signed-off-by: Markus Armbruster Message-Id: <20221121085054.683122-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'hw/arm') diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b871350..02d627a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2771,24 +2771,20 @@ static void virt_dimm_unplug_request(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { VirtMachineState *vms = VIRT_MACHINE(hotplug_dev); - Error *local_err = NULL; if (!vms->acpi_dev) { - error_setg(&local_err, + error_setg(errp, "memory hotplug is not enabled: missing acpi-ged device"); - goto out; + return; } if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) { - error_setg(&local_err, - "nvdimm device hot unplug is not supported yet."); - goto out; + error_setg(errp, "nvdimm device hot unplug is not supported yet."); + return; } hotplug_handler_unplug_request(HOTPLUG_HANDLER(vms->acpi_dev), dev, - &local_err); -out: - error_propagate(errp, local_err); + errp); } static void virt_dimm_unplug(HotplugHandler *hotplug_dev, -- cgit v1.1