cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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