qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 17/17] block: remove redundant check before g_slist_f


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PULL 17/17] block: remove redundant check before g_slist_find()
Date: Thu, 2 Jul 2015 10:19:49 +0100

From: Alberto Garcia <address@hidden>

An empty GSList is represented by a NULL pointer, therefore it's a
perfectly valid argument for g_slist_find() and there's no need to
make any additional check.

Signed-off-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 block/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/io.c b/block/io.c
index ad31822..305e0d9 100644
--- a/block/io.c
+++ b/block/io.c
@@ -283,7 +283,7 @@ void bdrv_drain_all(void)
         }
         aio_context_release(aio_context);
 
-        if (!aio_ctxs || !g_slist_find(aio_ctxs, aio_context)) {
+        if (!g_slist_find(aio_ctxs, aio_context)) {
             aio_ctxs = g_slist_prepend(aio_ctxs, aio_context);
         }
     }
-- 
2.4.3




reply via email to

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