diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-01-21 22:06:25 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-01-22 08:57:21 +0100 |
commit | f24245742636ef9996aae66e92244aed659b7d72 (patch) | |
tree | b38b45c49aba1826679d9a6c69cc157a9b046260 /common | |
parent | 17c4b989a5d00fe5fc84c528bbd59583c45d80d0 (diff) | |
download | barebox-f24245742636ef9996aae66e92244aed659b7d72.tar.gz barebox-f24245742636ef9996aae66e92244aed659b7d72.tar.xz |
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.c | 5 |
1 files changed, 2 insertions, 3 deletions
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; } |