iothread: Simplify expression in qemu_in_iothread()
authorKevin Wolf <kwolf@redhat.com>
Thu, 8 Feb 2024 10:16:57 +0000 (11:16 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 13 Feb 2024 07:59:25 +0000 (10:59 +0300)
'a == b ? false : true' is a rather convoluted way of writing 'a != b'.
Use the more obvious way to write it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
iothread.c

index 6c1fc8c8561d8a8a3b69f3d90d203b05a47ba52e..e1e9e0473651e13166b10e9537ffa53e60ac9c82 100644 (file)
@@ -404,6 +404,5 @@ IOThread *iothread_by_id(const char *id)
 
 bool qemu_in_iothread(void)
 {
-    return qemu_get_current_aio_context() == qemu_get_aio_context() ?
-                    false : true;
+    return qemu_get_current_aio_context() != qemu_get_aio_context();
 }