[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
- [Qemu-devel] [PULL 07/17] block: Add bdrv_get_block_status_above, (continued)
- [Qemu-devel] [PULL 07/17] block: Add bdrv_get_block_status_above, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 08/17] qmp: Add optional bool "unmap" to drive-mirror, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 09/17] mirror: Do zero write on target if sectors not allocated, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 10/17] block: Fix dirty bitmap in bdrv_co_discard, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 11/17] block: Remove bdrv_reset_dirty, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 12/17] qemu-iotests: Make block job methods common, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 13/17] qemu-iotests: Add test case for mirror with unmap, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 14/17] iotests: Use event_wait in wait_ready, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 15/17] block/iscsi: restore compatiblity with libiscsi 1.9.0, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 16/17] block/nfs: limit maximum readahead size to 1MB, Stefan Hajnoczi, 2015/07/02
- [Qemu-devel] [PULL 17/17] block: remove redundant check before g_slist_find(),
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PULL 00/17] Block patches, Peter Maydell, 2015/07/02
- Re: [Qemu-devel] [PULL 00/17] Block patches, Peter Maydell, 2015/07/07