summary refs log tree commit diff stats
path: root/bsd-user/qemu.h
diff options
context:
space:
mode:
authorWarner Losh <imp@bsdimp.com>2021-04-23 19:53:36 -0600
committerWarner Losh <imp@bsdimp.com>2021-05-11 11:07:21 -0600
commit3306693438c8ee770dca7ca5a365848d7bceef55 (patch)
tree11f726e37bc1ee9e142e34ecd72b748df742581d /bsd-user/qemu.h
parentc2bdd9a133dc9d47449c1a432df42ed38118e01c (diff)
downloadfocaccia-qemu-3306693438c8ee770dca7ca5a365848d7bceef55.tar.gz
focaccia-qemu-3306693438c8ee770dca7ca5a365848d7bceef55.zip
bsd-user: style tweak: don't assign in if statements
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Diffstat (limited to 'bsd-user/qemu.h')
-rw-r--r--bsd-user/qemu.h6
1 files 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 {                                                            \