summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-01-21 22:06:25 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-22 08:57:21 +0100
commitf24245742636ef9996aae66e92244aed659b7d72 (patch)
treeb38b45c49aba1826679d9a6c69cc157a9b046260 /common
parent17c4b989a5d00fe5fc84c528bbd59583c45d80d0 (diff)
downloadbarebox-f24245742636ef9996aae66e92244aed659b7d72.tar.gz
block: Move shared code in get_chunk() out of if statement
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/block.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/common/block.c b/common/block.c
index 3a031a4..2917218 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;
}