From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/4] block: shortcut writebuffer_flush if writing is disabled
Date: Mon, 22 Jul 2013 11:56:21 +0200 [thread overview]
Message-ID: <1374486983-5263-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1374486983-5263-1-git-send-email-s.hauer@pengutronix.de>
Saves a few bytes of binary space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/block.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/block.c b/common/block.c
index ad07f8b..ab39a36 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);
--
1.8.3.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-07-22 9:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 9:56 [PATCH] some minor image size decrease Sascha Hauer
2013-07-22 9:56 ` [PATCH 1/4] mtd: nand: omap: do not set write callback if mtd write is disabled Sascha Hauer
2013-07-22 9:56 ` Sascha Hauer [this message]
2013-07-22 9:56 ` [PATCH 3/4] ARM: omap4: Use writel where appropriate Sascha Hauer
2013-07-22 9:56 ` [PATCH 4/4] ARM: omap4: pcm049: register devices only when support is enabled Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374486983-5263-3-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox