From f24245742636ef9996aae66e92244aed659b7d72 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 21 Jan 2019 22:06:25 -0800 Subject: block: Move shared code in get_chunk() out of if statement Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- common/block.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'common/block.c') diff --git a/common/block.c b/common/block.c index 3a031a4fc7..2917218762 100644 --- a/common/block.c +++ b/common/block.c @@ -133,13 +133,12 @@ static struct chunk *get_chunk(struct block_device *blk) chunk->dirty = 0; } - - list_del(&chunk->list); } else { chunk = list_first_entry(&blk->idle_blocks, struct chunk, list); - list_del(&chunk->list); } + list_del(&chunk->list); + return chunk; } -- cgit v1.2.3