thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-s390x-sclp.c-remove-unneeded-label-in-sclp_service_c.patch

8fced6
From 8b06cba98e37b9c50e2a9deb1567d8cf4e1ba2b6 Mon Sep 17 00:00:00 2001
8fced6
From: Thomas Huth <thuth@redhat.com>
8fced6
Date: Wed, 11 Nov 2020 12:03:05 -0500
8fced6
Subject: [PATCH 05/18] s390x/sclp.c: remove unneeded label in
8fced6
 sclp_service_call()
8fced6
8fced6
RH-Author: Thomas Huth <thuth@redhat.com>
8fced6
Message-id: <20201111120316.707489-2-thuth@redhat.com>
8fced6
Patchwork-id: 99497
8fced6
O-Subject: [RHEL-8.4.0 qemu-kvm PATCH v2 01/12] s390x/sclp.c: remove unneeded label in sclp_service_call()
8fced6
Bugzilla: 1798506
8fced6
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
8fced6
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
8fced6
RH-Acked-by: David Hildenbrand <david@redhat.com>
8fced6
8fced6
From: Daniel Henrique Barboza <danielhb413@gmail.com>
8fced6
8fced6
'out' label can be replaced by 'return' with the appropriate
8fced6
value. The 'r' integer, which is used solely to set the
8fced6
return value for this label, can also be removed.
8fced6
8fced6
CC: Cornelia Huck <cohuck@redhat.com>
8fced6
CC: Halil Pasic <pasic@linux.ibm.com>
8fced6
CC: Christian Borntraeger <borntraeger@de.ibm.com>
8fced6
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
8fced6
Reviewed-by: Thomas Huth <thuth@redhat.com>
8fced6
Message-Id: <20200106182425.20312-39-danielhb413@gmail.com>
8fced6
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
8fced6
(cherry picked from commit e6de76fca48012348d8c81b1399c861f444bd4a4)
8fced6
Signed-off-by: Thomas Huth <thuth@redhat.com>
8fced6
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
8fced6
---
8fced6
 hw/s390x/sclp.c | 16 +++++-----------
8fced6
 1 file changed, 5 insertions(+), 11 deletions(-)
8fced6
8fced6
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
8fced6
index 1c380a49cc7..d8ae207731f 100644
8fced6
--- a/hw/s390x/sclp.c
8fced6
+++ b/hw/s390x/sclp.c
8fced6
@@ -241,24 +241,20 @@ int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code)
8fced6
 {
8fced6
     SCLPDevice *sclp = get_sclp_device();
8fced6
     SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
8fced6
-    int r = 0;
8fced6
     SCCB work_sccb;
8fced6
 
8fced6
     hwaddr sccb_len = sizeof(SCCB);
8fced6
 
8fced6
     /* first some basic checks on program checks */
8fced6
     if (env->psw.mask & PSW_MASK_PSTATE) {
8fced6
-        r = -PGM_PRIVILEGED;
8fced6
-        goto out;
8fced6
+        return -PGM_PRIVILEGED;
8fced6
     }
8fced6
     if (cpu_physical_memory_is_io(sccb)) {
8fced6
-        r = -PGM_ADDRESSING;
8fced6
-        goto out;
8fced6
+        return -PGM_ADDRESSING;
8fced6
     }
8fced6
     if ((sccb & ~0x1fffUL) == 0 || (sccb & ~0x1fffUL) == env->psa
8fced6
         || (sccb & ~0x7ffffff8UL) != 0) {
8fced6
-        r = -PGM_SPECIFICATION;
8fced6
-        goto out;
8fced6
+        return -PGM_SPECIFICATION;
8fced6
     }
8fced6
 
8fced6
     /*
8fced6
@@ -270,8 +266,7 @@ int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code)
8fced6
 
8fced6
     /* Valid sccb sizes */
8fced6
     if (be16_to_cpu(work_sccb.h.length) < sizeof(SCCBHeader)) {
8fced6
-        r = -PGM_SPECIFICATION;
8fced6
-        goto out;
8fced6
+        return -PGM_SPECIFICATION;
8fced6
     }
8fced6
 
8fced6
     if (!sclp_command_code_valid(code)) {
8fced6
@@ -291,8 +286,7 @@ out_write:
8fced6
 
8fced6
     sclp_c->service_interrupt(sclp, sccb);
8fced6
 
8fced6
-out:
8fced6
-    return r;
8fced6
+    return 0;
8fced6
 }
8fced6
 
8fced6
 static void service_interrupt(SCLPDevice *sclp, uint32_t sccb)
8fced6
-- 
8fced6
2.27.0
8fced6