From a3f1afb43a09e4577571c044c48f2ba9e6e4ad06 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Date: Mon, 11 May 2015 15:54:58 +0300 Subject: qcow2: make qcow2_cache_put() a void function This function never receives an invalid table pointer, so we can make it void and remove all the error checking code. Signed-off-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/qcow2-cache.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'block/qcow2-cache.c') diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index 121e6e9227..bde3c4fb13 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -330,14 +330,10 @@ int qcow2_cache_get_empty(BlockDriverState *bs, Qcow2Cache *c, uint64_t offset, return qcow2_cache_do_get(bs, c, offset, table, false); } -int qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table) +void qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table) { int i = qcow2_cache_get_table_idx(bs, c, *table); - if (c->entries[i].offset == 0) { - return -ENOENT; - } - c->entries[i].ref--; *table = NULL; @@ -346,7 +342,6 @@ int qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table) } assert(c->entries[i].ref >= 0); - return 0; } void qcow2_cache_entry_mark_dirty(BlockDriverState *bs, Qcow2Cache *c, -- cgit v1.2.1