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 <address@hidden>
---
block/qcow2-cache.c | 7 +------
block/qcow2-cluster.c | 50 ++++++++++----------------------------------------
block/qcow2-refcount.c | 29 +++++------------------------
block/qcow2.h | 2 +-
4 files changed, 17 insertions(+), 71 deletions(-)
diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
index 3137ba8..0f629c4 100644
--- a/block/qcow2-cache.c
+++ b/block/qcow2-cache.c
@@ -332,14 +332,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;
- }
-