From: Aleksander Jan Bajkowski <olek2@wp.pl>
To: ms@dev.tdt.de, miquel.raynal@bootlin.com, richard@nod.at,
vigneshr@ti.com, linus.walleij@linaro.org, nico@fluxnic.net,
olek2@wp.pl, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 1/1] mtd: cfi_cmdset_0001: Disable write buffer functions if FORCE_WORD_WRITE is 1
Date: Sun, 7 Jul 2024 11:43:02 +0200 [thread overview]
Message-ID: <20240707094302.784948-2-olek2@wp.pl> (raw)
In-Reply-To: <20240707094302.784948-1-olek2@wp.pl>
Some write buffer functions are not used when FORCE_WORD_WRITE is set to 1.
So the compile warning messages are output if FORCE_WORD_WRITE is 1. To
resolve this disable the write buffer functions if FORCE_WORD_WRITE is 1.
This is similar fix to: 557c759036fc3976a5358cef23e65a263853b93f.
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
---
drivers/mtd/chips/cfi_cmdset_0001.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index c10693ba265b..5404637e54e2 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -62,8 +62,10 @@
static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
+#if !FORCE_WORD_WRITE
static int cfi_intelext_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
static int cfi_intelext_writev(struct mtd_info *, const struct kvec *, unsigned long, loff_t, size_t *);
+#endif
static int cfi_intelext_erase_varsize(struct mtd_info *, struct erase_info *);
static void cfi_intelext_sync (struct mtd_info *);
static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
@@ -305,6 +307,7 @@ static void fixup_use_point(struct mtd_info *mtd)
}
}
+#if !FORCE_WORD_WRITE
static void fixup_use_write_buffers(struct mtd_info *mtd)
{
struct map_info *map = mtd->priv;
@@ -315,6 +318,7 @@ static void fixup_use_write_buffers(struct mtd_info *mtd)
mtd->_writev = cfi_intelext_writev;
}
}
+#endif /* !FORCE_WORD_WRITE */
/*
* Some chips power-up with all sectors locked by default.
@@ -1720,6 +1724,7 @@ static int cfi_intelext_write_words (struct mtd_info *mtd, loff_t to , size_t le
}
+#if !FORCE_WORD_WRITE
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const struct kvec **pvec,
unsigned long *pvec_seek, int len)
@@ -1948,6 +1953,7 @@ static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to,
return cfi_intelext_writev(mtd, &vec, 1, to, retlen);
}
+#endif /* !FORCE_WORD_WRITE */
static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
unsigned long adr, int len, void *thunk)
--
2.39.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2024-07-07 9:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-07 9:43 [PATCH v2 0/1] mtd: cfi_cmdset_0001: Fix compilation error if FORCE_WORD_WRITE is 1 Aleksander Jan Bajkowski
2024-07-07 9:43 ` Aleksander Jan Bajkowski [this message]
2024-07-08 6:24 ` [PATCH v2 1/1] mtd: cfi_cmdset_0001: Disable write buffer functions " Martin Schiller
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=20240707094302.784948-2-olek2@wp.pl \
--to=olek2@wp.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=ms@dev.tdt.de \
--cc=nico@fluxnic.net \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
/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