From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9YsT-0007ZF-N6 for qemu-devel@nongnu.org; Mon, 29 Jun 2015 09:13:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9YsO-00084P-O8 for qemu-devel@nongnu.org; Mon, 29 Jun 2015 09:13:37 -0400 From: Alberto Garcia Date: Mon, 29 Jun 2015 16:12:13 +0300 Message-Id: <1435583533-5758-1-git-send-email-berto@igalia.com> Subject: [Qemu-devel] [PATCH] block: remove redundant check before g_slist_find() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alberto Garcia , Stefan Hajnoczi , qemu-block@nongnu.org, 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 --- 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