diff mbox series

[04/15] spapr: Simplify error handling in callers of ppc_set_compat()

Message ID 20200914123505.612812-5-groug@kaod.org
State New
Headers show
Series spapr: Error handling fixes and cleanups (round 2) | expand

Commit Message

Greg Kurz Sept. 14, 2020, 12:34 p.m. UTC
Now that ppc_set_compat() indicates success/failure with a return
value, use it and reduce error propagation overhead.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/ppc/spapr.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Vladimir Sementsov-Ogievskiy Sept. 15, 2020, 9:51 a.m. UTC | #1
14.09.2020 15:34, Greg Kurz wrote:
> Now that ppc_set_compat() indicates success/failure with a return

> value, use it and reduce error propagation overhead.

> 

> Signed-off-by: Greg Kurz<groug@kaod.org>


Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>


-- 
Best regards,
Vladimir
Philippe Mathieu-Daudé Sept. 15, 2020, 1:02 p.m. UTC | #2
On 9/14/20 2:34 PM, Greg Kurz wrote:
> Now that ppc_set_compat() indicates success/failure with a return

> value, use it and reduce error propagation overhead.

> 

> Signed-off-by: Greg Kurz <groug@kaod.org>

> ---

>  hw/ppc/spapr.c | 7 +++----

>  1 file changed, 3 insertions(+), 4 deletions(-)


Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff mbox series

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index ea2c755310cd..c0a3f5f26d97 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3820,10 +3820,9 @@  static void spapr_core_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
      */
     if (hotplugged) {
         for (i = 0; i < cc->nr_threads; i++) {
-            ppc_set_compat(core->threads[i], POWERPC_CPU(first_cpu)->compat_pvr,
-                           &local_err);
-            if (local_err) {
-                error_propagate(errp, local_err);
+            if (ppc_set_compat(core->threads[i],
+                               POWERPC_CPU(first_cpu)->compat_pvr,
+                               errp) < 0) {
                 return;
             }
         }