From: Brian Norris <computersforpeace@gmail.com>
To: <linux-mtd@lists.infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Artem Bityutskiy <dedekind1@gmail.com>
Subject: [PATCH 5/8] mtd: nand: rename '_raw' BBT scan functions
Date: Fri, 22 Jun 2012 16:35:42 -0700 [thread overview]
Message-ID: <1340408145-24531-6-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <1340408145-24531-1-git-send-email-computersforpeace@gmail.com>
None of these scanning functions use MTD_OPS_RAW mode any more, so there's
really nothing 'raw' about them. Rename them to (hopefully) make the code
a little clearer.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
drivers/mtd/nand/nand_bbt.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 4123705..35e8cdf 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -288,7 +288,7 @@ static int read_abs_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_desc
}
/* BBT marker is in the first page, no OOB */
-static int scan_read_raw_data(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
+static int scan_read_data(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
struct nand_bbt_descr *td)
{
size_t retlen;
@@ -301,8 +301,8 @@ static int scan_read_raw_data(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
return mtd_read(mtd, offs, len, &retlen, buf);
}
-/* Scan read raw data from flash */
-static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
+/* Scan read data from flash */
+static int scan_read_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
size_t len)
{
struct mtd_oob_ops ops;
@@ -329,13 +329,13 @@ static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
return 0;
}
-static int scan_read_raw(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
+static int scan_read(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
size_t len, struct nand_bbt_descr *td)
{
if (td->options & NAND_BBT_NO_OOB)
- return scan_read_raw_data(mtd, buf, offs, td);
+ return scan_read_data(mtd, buf, offs, td);
else
- return scan_read_raw_oob(mtd, buf, offs, len);
+ return scan_read_oob(mtd, buf, offs, len);
}
/* Scan write data with oob to flash */
@@ -380,7 +380,7 @@ static void read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
/* Read the primary version, if available */
if (td->options & NAND_BBT_VERSION) {
- scan_read_raw(mtd, buf, (loff_t)td->pages[0] << this->page_shift,
+ scan_read(mtd, buf, (loff_t)td->pages[0] << this->page_shift,
mtd->writesize, td);
td->version[0] = buf[bbt_get_ver_offs(mtd, td)];
pr_info("Bad block table at page %d, version 0x%02X\n",
@@ -389,7 +389,7 @@ static void read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
/* Read the mirror version, if available */
if (md && (md->options & NAND_BBT_VERSION)) {
- scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift,
+ scan_read(mtd, buf, (loff_t)md->pages[0] << this->page_shift,
mtd->writesize, md);
md->version[0] = buf[bbt_get_ver_offs(mtd, md)];
pr_info("Bad block table at page %d, version 0x%02X\n",
@@ -404,7 +404,7 @@ static int scan_block_full(struct mtd_info *mtd, struct nand_bbt_descr *bd,
{
int ret, j;
- ret = scan_read_raw_oob(mtd, buf, offs, readlen);
+ ret = scan_read_oob(mtd, buf, offs, readlen);
/* Ignore ECC errors when checking for BBM */
if (ret && !mtd_is_bitflip_or_eccerr(ret))
return ret;
@@ -593,7 +593,7 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
loff_t offs = (loff_t)actblock << this->bbt_erase_shift;
/* Read first page */
- scan_read_raw(mtd, buf, offs, mtd->writesize, td);
+ scan_read(mtd, buf, offs, mtd->writesize, td);
if (!check_pattern(buf, scanlen, mtd->writesize, td)) {
td->pages[i] = actblock << blocktopage;
if (td->options & NAND_BBT_VERSION) {
--
1.7.10
next prev parent reply other threads:[~2012-06-22 23:35 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-22 23:35 [PATCH 0/8] NAND and NAND-BBT improvements Brian Norris
2012-06-22 23:35 ` [PATCH 1/8] mtd: move mtd_read_oob() definition out of mtd.h Brian Norris
2012-06-22 23:35 ` [PATCH 2/8] mtd: check for max_bitflips in mtd_read_oob() Brian Norris
2012-06-26 12:11 ` Shmulik Ladkani
2012-06-26 18:23 ` Mike Dunn
2012-07-11 2:12 ` Brian Norris
2012-08-15 11:24 ` Artem Bityutskiy
2012-08-15 19:15 ` Brian Norris
2012-08-16 10:48 ` Artem Bityutskiy
2012-08-17 22:58 ` Brian Norris
2012-06-22 23:35 ` [PATCH 3/8] mtd: nand: rename "no_bbt" descriptors to "no_oob" Brian Norris
2012-06-22 23:35 ` [PATCH 4/8] mtd: nand: remove unused 'int' return codes Brian Norris
2012-06-26 12:29 ` Shmulik Ladkani
2012-06-26 14:18 ` [PATCH 4/8] mtd: nand: remove unused 'int' return codes (SPAM) William F.
2012-08-15 11:40 ` [PATCH 4/8] mtd: nand: remove unused 'int' return codes Artem Bityutskiy
2012-06-22 23:35 ` Brian Norris [this message]
2012-06-26 12:39 ` [PATCH 5/8] mtd: nand: rename '_raw' BBT scan functions Shmulik Ladkani
2012-07-10 2:13 ` Brian Norris
2012-08-15 12:35 ` Artem Bityutskiy
2012-06-22 23:35 ` [PATCH 6/8] mtd: nand_bbt: refactor check_pattern_no_oob() Brian Norris
2012-06-22 23:35 ` [PATCH 7/8] mtd: nand_bbt: use string library Brian Norris
2012-06-26 13:37 ` Shmulik Ladkani
2012-07-16 6:06 ` Brian Norris
2012-07-16 23:57 ` Ivan Djelic
2012-08-15 11:53 ` Artem Bityutskiy
2012-06-22 23:35 ` [PATCH 8/8] mtd: nand: use ECC, if present, when scanning OOB Brian Norris
2012-06-26 14:09 ` Shmulik Ladkani
2012-07-10 2:39 ` Brian Norris
2012-07-10 7:45 ` Matthieu CASTET
2012-07-13 17:39 ` Brian Norris
2012-07-15 20:01 ` Mike Dunn
2012-07-16 14:01 ` Ivan Djelic
2012-07-16 18:36 ` Mike Dunn
2012-07-16 21:34 ` Ivan Djelic
2012-07-17 18:10 ` Mike Dunn
2013-11-07 14:56 ` Angus Clark
2013-11-18 18:36 ` Brian Norris
2012-08-15 12:05 ` Artem Bityutskiy
2012-08-15 14:31 ` Shmulik Ladkani
2012-08-16 10:40 ` Artem Bityutskiy
2012-08-20 13:12 ` Shmulik Ladkani
2012-06-27 13:52 ` [PATCH 0/8] NAND and NAND-BBT improvements Artem Bityutskiy
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=1340408145-24531-6-git-send-email-computersforpeace@gmail.com \
--to=computersforpeace@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@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;
as well as URLs for NNTP newsgroup(s).