qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] [PATCH v5 7/8] vl: don't use 'Yoda conditions'


From: arei.gonglei
Subject: [Qemu-trivial] [PATCH v5 7/8] vl: don't use 'Yoda conditions'
Date: Mon, 11 Aug 2014 21:00:57 +0800

From: Gonglei <address@hidden>

imitate nearby code about using '!value' or 'value == NULL'

Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
 vl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index a8029d5..9783133 100644
--- a/vl.c
+++ b/vl.c
@@ -1154,7 +1154,7 @@ static int drive_init_func(QemuOpts *opts, void *opaque)
 
 static int drive_enable_snapshot(QemuOpts *opts, void *opaque)
 {
-    if (NULL == qemu_opt_get(opts, "snapshot")) {
+    if (qemu_opt_get(opts, "snapshot") == NULL) {
         qemu_opt_set(opts, "snapshot", "on");
     }
     return 0;
@@ -2506,8 +2506,9 @@ static int foreach_device_config(int type, int 
(*func)(const char *cmdline))
         loc_push_restore(&conf->loc);
         rc = func(conf->cmdline);
         loc_pop(&conf->loc);
-        if (0 != rc)
+        if (rc) {
             return rc;
+        }
     }
     return 0;
 }
-- 
1.7.12.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]