lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160106143601.4d1f5b33@bbrezillon>
Date:	Wed, 6 Jan 2016 14:36:01 +0100
From:	Boris Brezillon <boris.brezillon@...e-electrons.com>
To:	Peter Pan <peterpansjtu@...il.com>
Cc:	computersforpeace@...il.com, dwmw2@...radead.org,
	fransklaver@...il.com, Peter Pan <peterpandong@...ron.com>,
	beanhuo@...ron.com, linux-mtd@...ts.infradead.org,
	linux-kernel@...r.kernel.org, karlzhang@...ron.com
Subject: Re: [PATCH v2 05/12] mtd: nand: use new BBT API instead of old ones

On Tue, 15 Dec 2015 05:59:31 +0000
Peter Pan <peterpansjtu@...il.com> wrote:

> From: Brian Norris <computersforpeace@...il.com>
> 
> Use new BBT APIs (nand_bbt_*()) in NAND. Keep old APIs (nand_*_bbt())
> exist temporarily.
> 
> Signed-off-by: Brian Norris <computersforpeace@...il.com>
> [Peter: 1. use nand_bbt_markbad_factory() in docg4.c and implement
>         2. nand_create_factory_badblock_pattern(), nand_is_bad_bbm() and
>         nand_default_bbt() in nand_base.c
>         3. add NAND_BADBLOCK_PATTERN_ALLOC macro]
> Signed-off-by: Peter Pan <peterpandong@...ron.com>
> ---
>  drivers/mtd/nand/docg4.c     |   6 +-
>  drivers/mtd/nand/nand_base.c | 140 ++++++++++++++++++++++++++++++++++++++++---
>  include/linux/mtd/nand.h     |   9 ++-
>  3 files changed, 143 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c
> index da93d7f..1be7fa2 100644
> --- a/drivers/mtd/nand/docg4.c
> +++ b/drivers/mtd/nand/docg4.c
> @@ -1037,7 +1037,7 @@ static int __init read_factory_bbt(struct mtd_info *mtd)
>  	 * operation after device power-up.  The above read ensures it never is.
>  	 * Ugly, I know.
>  	 */
> -	if (nand->bbt == NULL)  /* no memory-based bbt */
> +	if (nand->nand_bbt == NULL)  /* no memory-based bbt */

Hm, can we avoid direct references to the ->nand_bbt field by either
providing an accessor (nand_get_bbt()), or providing wrappers around
the nand_chip device (nand_has_bbt(nand), nand_markbad_factory(nand,
ofs), ...)?
In my rather limited experience, doing that is more future-proof.

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ