[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 57/59] linux-user/syscall.c: fix trailing whitespaces and styl
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v1 57/59] linux-user/syscall.c: fix trailing whitespaces and style |
Date: |
Mon, 6 Jan 2020 15:24:23 -0300 |
There are trailing whitespaces in this file that, if removed
by a text editor that refuses to let the traiing whitespace
alone, which happens to be the editor I am using, will cause
checkpatch.pl to warn about styling problems in the resulting
patch. This happens because the trailing whitespace lines
are using a deprecated style.
To keep the intended change I wanted to do (remove unneeded
labels in do_ioctl_blkpg() and do_sendrecvmsg_locked())
trivial, this patch is another trivial change to fix the
trailing whitespaces and the code style errors that
checkpatch.pl warns about. Doing this change beforehand will
keep the next patch focused just on the label removal changes.
CC: Riku Voipio <address@hidden>
CC: Laurent Vivier <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
linux-user/syscall.c | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 171c0caef3..49c6151c2d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1062,7 +1062,7 @@ static inline rlim_t target_to_host_rlim(abi_ulong
target_rlim)
{
abi_ulong target_rlim_swap;
rlim_t result;
-
+
target_rlim_swap = tswapal(target_rlim);
if (target_rlim_swap == TARGET_RLIM_INFINITY)
return RLIM_INFINITY;
@@ -1070,7 +1070,7 @@ static inline rlim_t target_to_host_rlim(abi_ulong
target_rlim)
result = target_rlim_swap;
if (target_rlim_swap != (rlim_t)result)
return RLIM_INFINITY;
-
+
return result;
}
@@ -1078,13 +1078,13 @@ static inline abi_ulong host_to_target_rlim(rlim_t rlim)
{
abi_ulong target_rlim_swap;
abi_ulong result;
-
+
if (rlim == RLIM_INFINITY || rlim != (abi_long)rlim)
target_rlim_swap = TARGET_RLIM_INFINITY;
else
target_rlim_swap = rlim;
result = tswapal(target_rlim_swap);
-
+
return result;
}
@@ -1526,10 +1526,11 @@ static inline abi_long target_to_host_cmsg(struct
msghdr *msgh,
abi_ulong target_cmsg_addr;
struct target_cmsghdr *target_cmsg, *target_cmsg_start;
socklen_t space = 0;
-
+
msg_controllen = tswapal(target_msgh->msg_controllen);
- if (msg_controllen < sizeof (struct target_cmsghdr))
+ if (msg_controllen < sizeof(struct target_cmsghdr)) {
goto the_end;
+ }
target_cmsg_addr = tswapal(target_msgh->msg_control);
target_cmsg = lock_user(VERIFY_READ, target_cmsg_addr, msg_controllen, 1);
target_cmsg_start = target_cmsg;
@@ -1610,8 +1611,9 @@ static inline abi_long host_to_target_cmsg(struct
target_msghdr *target_msgh,
socklen_t space = 0;
msg_controllen = tswapal(target_msgh->msg_controllen);
- if (msg_controllen < sizeof (struct target_cmsghdr))
+ if (msg_controllen < sizeof(struct target_cmsghdr)) {
goto the_end;
+ }
target_cmsg_addr = tswapal(target_msgh->msg_control);
target_cmsg = lock_user(VERIFY_WRITE, target_cmsg_addr, msg_controllen, 0);
target_cmsg_start = target_cmsg;
@@ -5592,9 +5594,9 @@ abi_long do_set_thread_area(CPUX86State *env, abi_ulong
ptr)
}
unlock_user_struct(target_ldt_info, ptr, 1);
- if (ldt_info.entry_number < TARGET_GDT_ENTRY_TLS_MIN ||
+ if (ldt_info.entry_number < TARGET_GDT_ENTRY_TLS_MIN ||
ldt_info.entry_number > TARGET_GDT_ENTRY_TLS_MAX)
- return -TARGET_EINVAL;
+ return -TARGET_EINVAL;
seg_32bit = ldt_info.flags & 1;
contents = (ldt_info.flags >> 1) & 3;
read_exec_only = (ldt_info.flags >> 3) & 1;
@@ -5670,7 +5672,7 @@ static abi_long do_get_thread_area(CPUX86State *env,
abi_ulong ptr)
lp = (uint32_t *)(gdt_table + idx);
entry_1 = tswap32(lp[0]);
entry_2 = tswap32(lp[1]);
-
+
read_exec_only = ((entry_2 >> 9) & 1) ^ 1;
contents = (entry_2 >> 10) & 3;
seg_not_present = ((entry_2 >> 15) & 1) ^ 1;
@@ -5686,8 +5688,8 @@ static abi_long do_get_thread_area(CPUX86State *env,
abi_ulong ptr)
(read_exec_only << 3) | (limit_in_pages << 4) |
(seg_not_present << 5) | (useable << 6) | (lm << 7);
limit = (entry_1 & 0xffff) | (entry_2 & 0xf0000);
- base_addr = (entry_1 >> 16) |
- (entry_2 & 0xff000000) |
+ base_addr = (entry_1 >> 16) |
+ (entry_2 & 0xff000000) |
((entry_2 & 0xff) << 16);
target_ldt_info->base_addr = tswapal(base_addr);
target_ldt_info->limit = tswap32(limit);
@@ -10554,8 +10556,10 @@ static abi_long do_syscall1(void *cpu_env, int num,
abi_long arg1,
return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
#if defined(TARGET_NR_fchownat)
case TARGET_NR_fchownat:
- if (!(p = lock_user_string(arg2)))
+ p = lock_user_string(arg2);
+ if (!p) {
return -TARGET_EFAULT;
+ }
ret = get_errno(fchownat(arg1, p, low2highuid(arg3),
low2highgid(arg4), arg5));
unlock_user(p, arg2, 0);
--
2.24.1
- [PATCH v1 47/59] pvrdma_main.c: remove unneeded labels, (continued)
- [PATCH v1 47/59] pvrdma_main.c: remove unneeded labels, 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 49/59] rdma/rdma_rm.c: remove unneeded label in rdma_rm_alloc_pd(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 50/59] rdma/rdma_backend.c: remove unneeded label in rdma_backend_init(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 51/59] virtio/vhost.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 52/59] net/vhost_net.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 53/59] net/net_tx_pkt.c: remove unneeded label in net_tx_pkt_get_gso_type(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 54/59] ivshmem-server/main.c: remove unneeded label in main(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 55/59] linux-user/flatload.c: remove unused 'out' label, 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 <=
- [PATCH v1 58/59] linux-user/syscall.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 59/59] linux-user/vm86.c: remove unneeded label in do_vm86(), Daniel Henrique Barboza, 2020/01/06
- Re: [PATCH v1 00/59] trivial unneeded labels cleanup, Corey Minyard, 2020/01/06