qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: remove redundant check before g_slist_find()
@ 2015-06-29 13:12 Alberto Garcia
  2015-06-29 13:32 ` Alexander Yarygin
  2015-06-30 12:54 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Alberto Garcia @ 2015-06-29 13:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alberto Garcia, Stefan Hajnoczi, qemu-block, Alexander Yarygin

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 <berto@igalia.com>
---
 block/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/io.c b/block/io.c
index e295992..2f7f889 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.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-30 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-29 13:12 [Qemu-devel] [PATCH] block: remove redundant check before g_slist_find() Alberto Garcia
2015-06-29 13:32 ` Alexander Yarygin
2015-06-30 12:54 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).