[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 38/48] bsd-user: style tweak: use {} for all if statements, fo
From: |
imp |
Subject: |
[PATCH v2 38/48] bsd-user: style tweak: use {} for all if statements, format else correctly |
Date: |
Sat, 24 Apr 2021 10:00:06 -0600 |
From: Warner Losh <imp@bsdimp.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/uaccess.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/bsd-user/uaccess.c b/bsd-user/uaccess.c
index aab5e995a9..2e8ad2982f 100644
--- a/bsd-user/uaccess.c
+++ b/bsd-user/uaccess.c
@@ -54,8 +54,9 @@ abi_long target_strlen(abi_ulong guest_addr1)
for (;;) {
max_len = TARGET_PAGE_SIZE - (guest_addr & ~TARGET_PAGE_MASK);
ptr = lock_user(VERIFY_READ, guest_addr, max_len, 1);
- if (!ptr)
+ if (!ptr) {
return -TARGET_EFAULT;
+ }
len = qemu_strnlen((const char *)ptr, max_len);
unlock_user(ptr, guest_addr, 0);
guest_addr += len;
@@ -63,8 +64,9 @@ abi_long target_strlen(abi_ulong guest_addr1)
if (guest_addr == 0 ||
(guest_addr - guest_addr1) > 0x7fffffff)
return -TARGET_EFAULT;
- if (len != max_len)
+ if (len != max_len) {
break;
+ }
}
return guest_addr - guest_addr1;
}
--
2.22.1
- [PATCH v2 39/48] bsd-user: style tweak: spaces around =, remove stray space, (continued)
- [PATCH v2 39/48] bsd-user: style tweak: spaces around =, remove stray space, imp, 2021/04/24
- [PATCH v2 11/48] bsd-user: style tweak: Remove #if 0'd code, imp, 2021/04/24
- [PATCH v2 25/48] bsd-user: move x86 (i386 and x86_64) cpu_loop to target_arch_cpu.h, imp, 2021/04/24
- [PATCH v2 26/48] bsd-user: move sparc cpu_loop into target_arch_cpu.h as target_cpu_loop, imp, 2021/04/24
- [PATCH v2 42/48] bsd-user: style tweak: spaces around operators and commas, imp, 2021/04/24
- [PATCH v2 38/48] bsd-user: style tweak: use {} for all if statements, format else correctly,
imp <=
- [PATCH v2 44/48] bsd-user: style tweak: use preferred block comments, imp, 2021/04/24
- [PATCH v2 48/48] bsd-user: put back a break; that had gone missing..., imp, 2021/04/24
- [PATCH v2 19/48] bsd-user: style tweak: move extern to header file, imp, 2021/04/24
- [PATCH v2 27/48] bsd-user: style tweak: space pedantry, imp, 2021/04/24
- [PATCH v2 35/48] bsd-user: style tweak: use {} for all if statements, format else correctly, imp, 2021/04/24