diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-19 11:58:43 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-22 11:49:01 +0200 |
commit | c7848ffee2646d55efe05c2df5b2d04b47dd9384 (patch) | |
tree | 02393ad7c7c651fdab980e53e95599c83a7943e3 | |
parent | 8c41c54da805eeae14e9d9d1cce58f49bcb9ecb6 (diff) | |
download | barebox-c7848ffee2646d55efe05c2df5b2d04b47dd9384.tar.gz barebox-c7848ffee2646d55efe05c2df5b2d04b47dd9384.tar.xz |
block: shortcut writebuffer_flush if writing is disabled
Saves a few bytes of binary space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/block.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/block.c b/common/block.c index ad07f8b2e2..ab39a3622c 100644 --- a/common/block.c +++ b/common/block.c @@ -43,6 +43,9 @@ static int writebuffer_flush(struct block_device *blk) { struct chunk *chunk; + if (!IS_ENABLED(CONFIG_BLOCK_WRITE)) + return 0; + list_for_each_entry(chunk, &blk->buffered_blocks, list) { if (chunk->dirty) { blk->ops->write(blk, chunk->data, chunk->block_start, blk->rdbufsize); |