public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: replace the hard code with the proper macro
@ 2012-07-03  8:44 Huang Shijie
  2012-07-03  8:44 ` [PATCH 2/2] mtd: fix the comment Huang Shijie
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Huang Shijie @ 2012-07-03  8:44 UTC (permalink / raw)
  To: dedekind1; +Cc: Huang Shijie, linux-mtd

Use the MTD_OPS_PLACE_OOB to replace the hard code "0".
Make the code more readable.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/nand/nand_base.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c58df65..5b8ab7f 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1633,7 +1633,7 @@ static int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
 	ops.len = len;
 	ops.datbuf = buf;
 	ops.oobbuf = NULL;
-	ops.mode = 0;
+	ops.mode = MTD_OPS_PLACE_OOB;
 	ret = nand_do_read_ops(mtd, from, &ops);
 	*retlen = ops.retlen;
 	nand_release_device(mtd);
@@ -2336,7 +2336,7 @@ static int panic_nand_write(struct mtd_info *mtd, loff_t to, size_t len,
 	ops.len = len;
 	ops.datbuf = (uint8_t *)buf;
 	ops.oobbuf = NULL;
-	ops.mode = 0;
+	ops.mode = MTD_OPS_PLACE_OOB;
 
 	ret = nand_do_write_ops(mtd, to, &ops);
 
@@ -2365,7 +2365,7 @@ static int nand_write(struct mtd_info *mtd, loff_t to, size_t len,
 	ops.len = len;
 	ops.datbuf = (uint8_t *)buf;
 	ops.oobbuf = NULL;
-	ops.mode = 0;
+	ops.mode = MTD_OPS_PLACE_OOB;
 	ret = nand_do_write_ops(mtd, to, &ops);
 	*retlen = ops.retlen;
 	nand_release_device(mtd);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] mtd: fix the comment
  2012-07-03  8:44 [PATCH 1/2] mtd: replace the hard code with the proper macro Huang Shijie
@ 2012-07-03  8:44 ` Huang Shijie
  2012-07-11  1:43 ` [PATCH 1/2] mtd: replace the hard code with the proper macro Brian Norris
  2012-07-16 15:06 ` Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Huang Shijie @ 2012-07-03  8:44 UTC (permalink / raw)
  To: dedekind1; +Cc: Huang Shijie, linux-mtd

fix the comment for nand_bbt.c

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/nand/nand_bbt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 30d1319..3972fc4 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -22,7 +22,7 @@
  * BBT on flash. If a BBT is found then the contents are read and the memory
  * based BBT is created. If a mirrored BBT is selected then the mirror is
  * searched too and the versions are compared. If the mirror has a greater
- * version number than the mirror BBT is used to build the memory based BBT.
+ * version number, then the mirror BBT is used to build the memory based BBT.
  * If the tables are not versioned, then we "or" the bad block information.
  * If one of the BBTs is out of date or does not exist it is (re)created.
  * If no BBT exists at all then the device is scanned for factory marked
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] mtd: replace the hard code with the proper macro
  2012-07-03  8:44 [PATCH 1/2] mtd: replace the hard code with the proper macro Huang Shijie
  2012-07-03  8:44 ` [PATCH 2/2] mtd: fix the comment Huang Shijie
@ 2012-07-11  1:43 ` Brian Norris
  2012-07-16 15:06 ` Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2012-07-11  1:43 UTC (permalink / raw)
  To: Huang Shijie; +Cc: linux-mtd, dedekind1

On Tue, Jul 3, 2012 at 1:44 AM, Huang Shijie <b32955@freescale.com> wrote:
> Use the MTD_OPS_PLACE_OOB to replace the hard code "0".
> Make the code more readable.

I think I intentionally used 0 instead of an explicit mode, since the
mode was mostly for when oobbuf != NULL; i.e., MTD_OPS_PLACE_OOB vs.
MTD_OPS_AUTO_OOB was a don't care in this case. But now that you
mention it, this is probably more readable.

> Signed-off-by: Huang Shijie <b32955@freescale.com>

Acked-by: Brian Norris <computersforpeace@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] mtd: replace the hard code with the proper macro
  2012-07-03  8:44 [PATCH 1/2] mtd: replace the hard code with the proper macro Huang Shijie
  2012-07-03  8:44 ` [PATCH 2/2] mtd: fix the comment Huang Shijie
  2012-07-11  1:43 ` [PATCH 1/2] mtd: replace the hard code with the proper macro Brian Norris
@ 2012-07-16 15:06 ` Artem Bityutskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-07-16 15:06 UTC (permalink / raw)
  To: Huang Shijie; +Cc: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

On Tue, 2012-07-03 at 16:44 +0800, Huang Shijie wrote:
> Use the MTD_OPS_PLACE_OOB to replace the hard code "0".
> Make the code more readable.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>

Pushed both to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-16 15:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-03  8:44 [PATCH 1/2] mtd: replace the hard code with the proper macro Huang Shijie
2012-07-03  8:44 ` [PATCH 2/2] mtd: fix the comment Huang Shijie
2012-07-11  1:43 ` [PATCH 1/2] mtd: replace the hard code with the proper macro Brian Norris
2012-07-16 15:06 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox