[PATCH v2 41/48] bsd-user: style tweak: don't assign in if statements

imp@bsdimp.com posted 48 patches 4 years, 9 months ago
Maintainers: Kyle Evans <kevans@freebsd.org>, Warner Losh <imp@bsdimp.com>
[PATCH v2 41/48] bsd-user: style tweak: don't assign in if statements
Posted by imp@bsdimp.com 4 years, 9 months ago
From: Warner Losh <imp@bsdimp.com>

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
 bsd-user/strace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bsd-user/strace.c b/bsd-user/strace.c
index aa4ab8cee7..94f2b59565 100644
--- a/bsd-user/strace.c
+++ b/bsd-user/strace.c
@@ -80,7 +80,8 @@ static void print_execve(const struct syscallname *name, abi_long arg1,
         if (!arg_addr) {
             break;
         }
-        if ((s = lock_user_string(arg_addr))) {
+        s = lock_user_string(arg_addr);
+        if (s) {
             gemu_log("\"%s\",", s);
             unlock_user(s, arg_addr, 0);
         }
-- 
2.22.1


Re: [PATCH v2 41/48] bsd-user: style tweak: don't assign in if statements
Posted by Richard Henderson 4 years, 9 months ago
On 4/24/21 9:00 AM, imp@bsdimp.com wrote:
> From: Warner Losh<imp@bsdimp.com>
> 
> Signed-off-by: Warner Losh<imp@bsdimp.com>
> ---
>   bsd-user/strace.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~