mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] mtd: only build mtdraw_raw_to_mtd_offset when write support is enabled
Date: Thu, 11 May 2017 11:41:08 +0200	[thread overview]
Message-ID: <20170511094108.17088-3-l.stach@pengutronix.de> (raw)
In-Reply-To: <20170511094108.17088-1-l.stach@pengutronix.de>

mtdraw_raw_to_mtd_offset() is only used from mtdraw_erase(), so will
only be referenced when MTD write support is enabled. This fixes a
harmless warning.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/mtd/mtdraw.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c
index d0b5f759263d..ab360b78623a 100644
--- a/drivers/mtd/mtdraw.c
+++ b/drivers/mtd/mtdraw.c
@@ -92,11 +92,6 @@ static unsigned int mtdraw_offset_to_block(struct mtd_info *mtd, loff_t offset)
 	return ofs64;
 }
 
-static loff_t mtdraw_raw_to_mtd_offset(struct mtd_info *mtd, loff_t offset)
-{
-	return (loff_t)mtdraw_offset_to_block(mtd, offset) * mtd->writesize;
-}
-
 static ssize_t mtdraw_read_unaligned(struct mtd_info *mtd, void *dst,
 				     size_t count, int skip, ulong offset)
 {
@@ -159,6 +154,11 @@ static ssize_t mtdraw_read(struct cdev *cdev, void *buf, size_t count,
 }
 
 #ifdef CONFIG_MTD_WRITE
+static loff_t mtdraw_raw_to_mtd_offset(struct mtd_info *mtd, loff_t offset)
+{
+	return (loff_t)mtdraw_offset_to_block(mtd, offset) * mtd->writesize;
+}
+
 static ssize_t mtdraw_blkwrite(struct mtd_info *mtd, const void *buf,
 			       ulong offset)
 {
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-05-11  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  9:41 [PATCH 1/3] ARM: socfpga: fix QSPI platform data init Lucas Stach
2017-05-11  9:41 ` [PATCH 2/3] param: fix stub prototype of dev_add_param Lucas Stach
2017-05-11  9:41 ` Lucas Stach [this message]
2017-05-17  6:18 ` [PATCH 1/3] ARM: socfpga: fix QSPI platform data init 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=20170511094108.17088-3-l.stach@pengutronix.de \
    --to=l.stach@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