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

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