[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 37/48] bsd-user: style tweak: don't assign in if statements
From: |
imp |
Subject: |
[PATCH v2 37/48] bsd-user: style tweak: don't assign in if statements |
Date: |
Sat, 24 Apr 2021 10:00:05 -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 7eb4546fed..aab5e995a9 100644
--- a/bsd-user/uaccess.c
+++ b/bsd-user/uaccess.c
@@ -14,7 +14,8 @@ abi_long copy_from_user(void *hptr, abi_ulong gaddr, size_t
len)
abi_long ret = 0;
void *ghptr;
- if ((ghptr = lock_user(VERIFY_READ, gaddr, len, 1))) {
+ ghptr = lock_user(VERIFY_READ, gaddr, len, 1);
+ if (ghptr) {
memcpy(hptr, ghptr, len);
unlock_user(ghptr, gaddr, 0);
} else
@@ -29,7 +30,8 @@ abi_long copy_to_user(abi_ulong gaddr, void *hptr, size_t len)
abi_long ret = 0;
void *ghptr;
- if ((ghptr = lock_user(VERIFY_WRITE, gaddr, len, 0))) {
+ ghptr = lock_user(VERIFY_WRITE, gaddr, len, 0);
+ if (ghptr) {
memcpy(ghptr, hptr, len);
unlock_user(ghptr, gaddr, len);
} else
--
2.22.1
- [PATCH v2 24/48] bsd-user: create target_arch_cpu.h, (continued)
- [PATCH v2 24/48] bsd-user: create target_arch_cpu.h, imp, 2021/04/24
- [PATCH v2 32/48] bsd-user: style tweak: remove spacing after '*' and add after }, imp, 2021/04/24
- [PATCH v2 28/48] bsd-user: style tweak: comments, imp, 2021/04/24
- [PATCH v2 16/48] bsd-user: style tweak: Put {} around all if/else/for statements, imp, 2021/04/24
- [PATCH v2 18/48] bsd-user: style tweak: Use preferred block comments, imp, 2021/04/24
- [PATCH v2 33/48] bsd-user: style tweak: Use preferred block comments, imp, 2021/04/24
- [PATCH v2 37/48] bsd-user: style tweak: don't assign in if statements,
imp <=
- [PATCH v2 41/48] bsd-user: style tweak: don't assign in if statements, imp, 2021/04/24
- [PATCH v2 40/48] bsd-user: style tweak: Use preferred block comments, imp, 2021/04/24
- [PATCH v2 43/48] bsd-user: style tweak: fold long lines, imp, 2021/04/24
- [PATCH v2 29/48] bsd-user: style tweak: use {} correctly, imp, 2021/04/24
- [PATCH v2 23/48] bsd-user: introduce host_os.h for bsd-specific code and defaults, imp, 2021/04/24