From: Warner Losh Date: Sat, 24 Apr 2021 01:53:36 +0000 (-0600) Subject: bsd-user: style tweak: don't assign in if statements X-Git-Tag: v6.1.0-rc0~111^2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3306693438c8ee770dca7ca5a365848d7bceef55;p=thirdparty%2Fqemu.git bsd-user: style tweak: don't assign in if statements Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 7f3cfa68aae..2494d9209d6 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 { \