staging: unisys: visorbus: get rid of gotos in intialize_controlvm_payload_info
authorDavid Kershner <david.kershner@unisys.com>
Fri, 11 Mar 2016 22:01:39 +0000 (17:01 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
Get rid of the gotos in initialize_controlvm_payload_info. The check in
the error path if payload was valid was never called so get rid of that
as well.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorchipset.c

index 3fd4bea6535df7e978f8c2c627ea94cb79498919..6ab659cbd6d5074ff5db44c377297cefc55ff361 100644 (file)
@@ -1382,35 +1382,23 @@ initialize_controlvm_payload_info(u64 phys_addr, u64 offset, u32 bytes,
                                  struct visor_controlvm_payload_info *info)
 {
        u8 *payload = NULL;
-       int rc = CONTROLVM_RESP_SUCCESS;
 
-       if (!info) {
-               rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
-               goto cleanup;
-       }
+       if (!info)
+               return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
+
        memset(info, 0, sizeof(struct visor_controlvm_payload_info));
-       if ((offset == 0) || (bytes == 0)) {
-               rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
-               goto cleanup;
-       }
+       if ((offset == 0) || (bytes == 0))
+               return -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
+
        payload = memremap(phys_addr + offset, bytes, MEMREMAP_WB);
-       if (!payload) {
-               rc = -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
-               goto cleanup;
-       }
+       if (!payload)
+               return -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
 
        info->offset = offset;
        info->bytes = bytes;
        info->ptr = payload;
 
-cleanup:
-       if (rc < 0) {
-               if (payload) {
-                       memunmap(payload);
-                       payload = NULL;
-               }
-       }
-       return rc;
+       return CONTROLVM_RESP_SUCCESS;
 }
 
 static void