[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/20] bsd-user: style tweak: don't assign in if statements
From: |
Warner Losh |
Subject: |
[PULL 09/20] bsd-user: style tweak: don't assign in if statements |
Date: |
Wed, 12 May 2021 11:17:09 -0600 |
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/qemu.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 7f3cfa68aa..2494d9209d 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -288,7 +288,8 @@ static inline bool access_ok(int type, abi_ulong addr,
abi_ulong size)
abi_ulong __gaddr = (gaddr); \
target_type *__hptr; \
abi_long __ret; \
- if ((__hptr = lock_user(VERIFY_WRITE, __gaddr, sizeof(target_type), 0))) {
\
+ __hptr = lock_user(VERIFY_WRITE, __gaddr, sizeof(target_type), 0); \
+ if (__hptr) { \
__ret = __put_user((x), __hptr); \
unlock_user(__hptr, __gaddr, sizeof(target_type)); \
} else \
@@ -301,7 +302,8 @@ static inline bool access_ok(int type, abi_ulong addr,
abi_ulong size)
abi_ulong __gaddr = (gaddr); \
target_type *__hptr; \
abi_long __ret; \
- if ((__hptr = lock_user(VERIFY_READ, __gaddr, sizeof(target_type), 1))) { \
+ __hptr = lock_user(VERIFY_READ, __gaddr, sizeof(target_type), 1); \
+ if (__hptr) { \
__ret = __get_user((x), __hptr); \
unlock_user(__hptr, __gaddr, 0); \
} else { \
--
2.22.1
- [PULL 00/20] bsd-user style tweaks and start cleanup, Warner Losh, 2021/05/12
- [PULL 01/20] bsd-user: whitespace changes, Warner Losh, 2021/05/12
- [PULL 03/20] bsd-user: style tweak: Remove #if 0'd code, Warner Losh, 2021/05/12
- [PULL 02/20] bsd-user: style tweak: use C not C++ comments, Warner Losh, 2021/05/12
- [PULL 10/20] bsd-user: style tweak: use {} for all if statements, format else correctly, Warner Losh, 2021/05/12
- [PULL 06/20] bsd-user: style tweak: move extern to header file, Warner Losh, 2021/05/12
- [PULL 07/20] bsd-user: style tweak: remove spacing after '*' and add after }, Warner Losh, 2021/05/12
- [PULL 09/20] bsd-user: style tweak: don't assign in if statements,
Warner Losh <=
- [PULL 13/20] bsd-user: whitespace changes, Warner Losh, 2021/05/12
- [PULL 04/20] bsd-user: style tweak: Use preferred block comments, Warner Losh, 2021/05/12
- [PULL 05/20] bsd-user: Remove commented out code, Warner Losh, 2021/05/12
- [PULL 08/20] bsd-user: style tweak: Use preferred block comments, Warner Losh, 2021/05/12
- [PULL 15/20] bsd-user: style tweak: keyword space (, Warner Losh, 2021/05/12
- [PULL 11/20] bsd-user: style tweak: use {} consistently in for / if / else statements, Warner Losh, 2021/05/12
- [PULL 18/20] bsd-user: remove target_signal.h, it's unused, Warner Losh, 2021/05/12
- [PULL 14/20] bsd-user: style tweak: keyword space (, Warner Losh, 2021/05/12
- [PULL 17/20] bsd-user: style tweak: keyword space (, Warner Losh, 2021/05/12
- [PULL 19/20] bsd-user: Stop building the sparc targets, Warner Losh, 2021/05/12