[PATCH 3/3] mtd: only build mtdraw_raw_to_mtd_offset when write support is enabled

Lucas Stach l.stach at pengutronix.de
Thu May 11 02:41:08 PDT 2017


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 at 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




More information about the barebox mailing list