Received: from eggs.gnu.org ([2001:4830:134:3::10]:54125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAagG-00039E-PS for qemu-devel@nongnu.org; Thu, 02 Jul 2015 05:21:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAagC-0000wf-89 for qemu-devel@nongnu.org; Thu, 02 Jul 2015 05:21:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAagB-0000vo-TF for qemu-devel@nongnu.org; Thu, 02 Jul 2015 05:21:12 -0400 From: Stefan Hajnoczi Date: Thu, 2 Jul 2015 10:19:49 +0100 Message-Id: <1435828789-9647-18-git-send-email-stefanha@redhat.com> In-Reply-To: <1435828789-9647-1-git-send-email-stefanha@redhat.com> References: <1435828789-9647-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 17/17] 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: Kevin Wolf , Peter Maydell , Alberto Garcia , Stefan Hajnoczi From: Alberto Garcia 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 Message-id: 1435583533-5758-1-git-send-email-berto@igalia.com Signed-off-by: Stefan Hajnoczi --- 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