[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 58/59] linux-user/syscall.c: remove unneeded labels
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v1 58/59] linux-user/syscall.c: remove unneeded labels |
Date: |
Mon, 6 Jan 2020 15:24:24 -0300 |
'out2' label in do_sendrecvmsg_locked() can be replaced by
'return' with the adequate exit value. Same thing with the
label 'out' in do_ioctl_blkpg(), and in that function we
can get rid of the 'ret' variable as well.
CC: Riku Voipio <address@hidden>
CC: Laurent Vivier <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
linux-user/syscall.c | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 49c6151c2d..5db066921e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2941,7 +2941,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct
target_msghdr *msgp,
*/
msg.msg_name = (void *)-1;
} else if (ret) {
- goto out2;
+ return ret;
}
} else {
msg.msg_name = NULL;
@@ -2960,15 +2960,13 @@ static abi_long do_sendrecvmsg_locked(int fd, struct
target_msghdr *msgp,
/* sendrcvmsg returns a different errno for this condition than
* readv/writev, so we must catch it here before lock_iovec() does.
*/
- ret = -TARGET_EMSGSIZE;
- goto out2;
+ return -TARGET_EMSGSIZE;
}
vec = lock_iovec(send ? VERIFY_READ : VERIFY_WRITE,
target_vec, count, send);
if (vec == NULL) {
- ret = -host_to_target_errno(errno);
- goto out2;
+ return -host_to_target_errno(errno);
}
msg.msg_iovlen = count;
msg.msg_iov = vec;
@@ -3020,7 +3018,6 @@ static abi_long do_sendrecvmsg_locked(int fd, struct
target_msghdr *msgp,
out:
unlock_iovec(vec, target_vec, count, !send);
-out2:
return ret;
}
@@ -4952,7 +4949,6 @@ static abi_long do_ioctl_blkpg(const IOCTLEntry *ie,
uint8_t *buf_temp, int fd,
int target_size;
const argtype *arg_type = ie->arg_type;
const argtype part_arg_type[] = { MK_STRUCT(STRUCT_blkpg_partition) };
- abi_long ret;
struct blkpg_ioctl_arg *host_blkpg = (void*)buf_temp;
struct blkpg_partition host_part;
@@ -4962,8 +4958,7 @@ static abi_long do_ioctl_blkpg(const IOCTLEntry *ie,
uint8_t *buf_temp, int fd,
target_size = thunk_type_size(arg_type, 0);
argptr = lock_user(VERIFY_READ, arg, target_size, 1);
if (!argptr) {
- ret = -TARGET_EFAULT;
- goto out;
+ return -TARGET_EFAULT;
}
thunk_convert(buf_temp, argptr, arg_type, THUNK_HOST);
unlock_user(argptr, arg, 0);
@@ -4975,8 +4970,7 @@ static abi_long do_ioctl_blkpg(const IOCTLEntry *ie,
uint8_t *buf_temp, int fd,
break;
default:
/* Unknown opcode */
- ret = -TARGET_EINVAL;
- goto out;
+ return -TARGET_EINVAL;
}
/* Read and convert blkpg->data */
@@ -4984,18 +4978,14 @@ static abi_long do_ioctl_blkpg(const IOCTLEntry *ie,
uint8_t *buf_temp, int fd,
target_size = thunk_type_size(part_arg_type, 0);
argptr = lock_user(VERIFY_READ, arg, target_size, 1);
if (!argptr) {
- ret = -TARGET_EFAULT;
- goto out;
+ return -TARGET_EFAULT;
}
thunk_convert(&host_part, argptr, part_arg_type, THUNK_HOST);
unlock_user(argptr, arg, 0);
/* Swizzle the data pointer to our local copy and call! */
host_blkpg->data = &host_part;
- ret = get_errno(safe_ioctl(fd, ie->host_cmd, host_blkpg));
-
-out:
- return ret;
+ return get_errno(safe_ioctl(fd, ie->host_cmd, host_blkpg));
}
static abi_long do_ioctl_rt(const IOCTLEntry *ie, uint8_t *buf_temp,
--
2.24.1
- [PATCH v1 55/59] linux-user/flatload.c: remove unused 'out' label, (continued)
- [PATCH v1 55/59] linux-user/flatload.c: remove unused 'out' label, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 32/59] qemu-img.c: remove 'out4' label in img_compare, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 36/59] ipmi/ipmi_kcs.c: remove unneeded label in ipmi_kcs_handle_event, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 42/59] i386/intel_iommu.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 46/59] alpha/typhoon.c: remove unneeded label in typhoon_translate_iommu(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 48/59] pvrdma_dev_ring.c: remove unneeded label in pvrdma_ring_init(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 56/59] linux-user/signal.c: remove unneeded label in do_sigaltstack(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 57/59] linux-user/syscall.c: fix trailing whitespaces and style, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 58/59] linux-user/syscall.c: remove unneeded labels,
Daniel Henrique Barboza <=
- [PATCH v1 59/59] linux-user/vm86.c: remove unneeded label in do_vm86(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 05/59] ram.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 14/59] block/file-posix.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 25/59] block/vhdx.c: remove unneeded 'exit' labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 29/59] cryptodev-vhost.c: remove unneeded 'err' label in cryptodev_vhost_start, Daniel Henrique Barboza, 2020/01/06