From c7848ffee2646d55efe05c2df5b2d04b47dd9384 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 19 Jul 2013 11:58:43 +0200 Subject: block: shortcut writebuffer_flush if writing is disabled Saves a few bytes of binary space. Signed-off-by: Sascha Hauer --- common/block.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common/block.c') 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); -- cgit v1.2.3