From: Brian Norris <computersforpeace@gmail.com>
To: Huang Shijie <b32955@freescale.com>
Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org, dedekind1@gmail.com
Subject: Re: [PATCH 02/10] mtd: add a helper to check the SLC/MLC nand chip
Date: Mon, 12 Aug 2013 17:52:34 -0700 [thread overview]
Message-ID: <20130813005234.GE7267@brian-ubuntu> (raw)
In-Reply-To: <1376286173-12581-3-git-send-email-b32955@freescale.com>
On Mon, Aug 12, 2013 at 01:42:45PM +0800, Huang Shijie wrote:
> Add a helper to check if a nand chip is SLC or MLC.
> This helper makes the code more readable.
>
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
> drivers/mtd/nand/denali.c | 2 +-
> drivers/mtd/nand/nand_base.c | 14 ++++++--------
> include/linux/mtd/nand.h | 9 +++++++++
> 3 files changed, 16 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
> index 2ed2bb3..645721e 100644
> --- a/drivers/mtd/nand/denali.c
> +++ b/drivers/mtd/nand/denali.c
> @@ -1520,7 +1520,7 @@ int denali_init(struct denali_nand_info *denali)
> * so just let controller do 15bit ECC for MLC and 8bit ECC for
> * SLC if possible.
> * */
> - if (denali->nand.cellinfo & NAND_CI_CELLTYPE_MSK &&
> + if (!nand_is_slc(&denali->nand) &&
According to my recommendations in patch 1, this would only need to be:
if (denali->nand.bits_per_cell > 1 && ...)
IMO, that is plenty readable, then we don't need the helper.
> (denali->mtd.oobsize > (denali->bbtskipbytes +
> ECC_15BITS * (denali->mtd.writesize /
> ECC_SECTOR_SIZE)))) {
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index ee1aa52..fd5117d 100644
(ditto elsewhere)
Thanks,
Brian
next prev parent reply other threads:[~2013-08-13 0:52 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 5:42 [PATCH 00/10] About the SLC/MLC Huang Shijie
2013-08-12 5:42 ` [PATCH 01/10] mtd: set the cell information for ONFI nand Huang Shijie
2013-08-12 7:22 ` Gupta, Pekon
2013-08-12 7:27 ` Huang Shijie
2013-08-13 0:49 ` Brian Norris
2013-08-13 2:32 ` Huang Shijie
2013-08-13 2:59 ` Brian Norris
[not found] ` <5209A1F2.80600@freescale.com>
2013-08-13 3:17 ` Brian Norris
2013-08-13 3:21 ` Huang Shijie
2013-08-13 4:10 ` Gupta, Pekon
2013-08-13 6:19 ` Huang Shijie
2013-08-12 5:42 ` [PATCH 02/10] mtd: add a helper to check the SLC/MLC nand chip Huang Shijie
2013-08-13 0:52 ` Brian Norris [this message]
2013-08-13 2:35 ` Huang Shijie
2013-08-13 2:52 ` Brian Norris
2013-08-12 5:42 ` [PATCH 03/10] mtd: print out the cell information for " Huang Shijie
2013-08-12 5:42 ` [PATCH 04/10] mtd: gpmi: rewrite the gpmi_ecc_write_oob() to support the jffs2 Huang Shijie
2013-08-12 5:42 ` [PATCH 05/10] mtd: add more comment for MTD_NANDFLASH/MTD_MLCNANDFLASH Huang Shijie
2013-08-12 5:42 ` [PATCH 06/10] mtd: fix the wrong mtd->type for nand chip Huang Shijie
2013-08-12 5:42 ` [PATCH 07/10] jffs2: init the ret with -EINVAL Huang Shijie
2013-08-12 5:42 ` [PATCH 08/10] mtd: add MTD_MLCNANDFLASH case for mtd_type_show() Huang Shijie
2013-08-13 1:05 ` Brian Norris
2013-08-13 2:20 ` Huang Shijie
2013-08-13 3:10 ` Brian Norris
2013-08-13 3:18 ` Huang Shijie
2013-08-12 5:42 ` [PATCH 09/10] mtd: add more information for the MTD_NANDFLASH case Huang Shijie
2013-08-13 1:07 ` Brian Norris
2013-08-12 5:42 ` [PATCH 10/10] mtd: add a helper to detect the nand type Huang Shijie
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=20130813005234.GE7267@brian-ubuntu \
--to=computersforpeace@gmail.com \
--cc=b32955@freescale.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