diff options
author | David Kershner <[email protected]> | 2016-03-11 17:01:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2016-03-28 07:30:36 -0700 |
commit | dde29996cdb1514a457ffbfaaf8f795d66fe2a5a (patch) | |
tree | f2c6d71201edbe9e110fa355407d8abf3be27bac | |
parent | b899963f158056f19928ed5dc7314fac5b57db97 (diff) |
staging: unisys: visorbus: get rid of gotos in intialize_controlvm_payload_info
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 <[email protected]>
Signed-off-by: Timothy Sell <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/staging/unisys/visorbus/visorchipset.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 3fd4bea6535d..6ab659cbd6d5 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -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 |