diff mbox series

[v3,12/40] mtd: nand: Rename a core structure

Message ID 20190919193141.7865-13-miquel.raynal@bootlin.com (mailing list archive)
State New, archived
Headers show
Series Introduce the generic ECC engine abstraction | expand

Commit Message

Miquel Raynal Sept. 19, 2019, 7:31 p.m. UTC
Prepare the migration to a generic ECC engine by renaming the
nand_ecc_req structure into nand_ecc_props. This structure will be the
base of a wider 'nand_ecc' structure.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 include/linux/mtd/nand.h    | 8 ++++----
 include/linux/mtd/spinand.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Boris Brezillon Oct. 12, 2019, 9:35 a.m. UTC | #1
On Thu, 19 Sep 2019 21:31:12 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Prepare the migration to a generic ECC engine by renaming the
> nand_ecc_req structure into nand_ecc_props. This structure will be the
> base of a wider 'nand_ecc' structure.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  include/linux/mtd/nand.h    | 8 ++++----
>  include/linux/mtd/spinand.h | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> index 531c1799bf2c..7072f14239e5 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -128,11 +128,11 @@ struct nand_page_io_req {
>  };
>  
>  /**
> - * struct nand_ecc_req - NAND ECC requirements
> + * struct nand_ecc_props - NAND ECC properties
>   * @strength: ECC strength
> - * @step_size: ECC step/block size
> + * @step_size: Number of bytes per step
>   */
> -struct nand_ecc_req {
> +struct nand_ecc_props {
>  	unsigned int strength;
>  	unsigned int step_size;
>  };
> @@ -191,7 +191,7 @@ struct nand_ops {
>  struct nand_device {
>  	struct mtd_info mtd;
>  	struct nand_memory_organization memorg;
> -	struct nand_ecc_req eccreq;
> +	struct nand_ecc_props eccreq;

Let's rename this field too: s/eccreq/eccprops/

>  	struct nand_row_converter rowconv;
>  	struct nand_bbt bbt;
>  	const struct nand_ops *ops;
> diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
> index 4ea558bd3c46..fad19058e28f 100644
> --- a/include/linux/mtd/spinand.h
> +++ b/include/linux/mtd/spinand.h
> @@ -294,7 +294,7 @@ struct spinand_info {
>  	u16 devid;
>  	u32 flags;
>  	struct nand_memory_organization memorg;
> -	struct nand_ecc_req eccreq;
> +	struct nand_ecc_props eccreq;

This once can stay unchanged since we're actually describing the ECC
requirements here, not the final ECC properties (actual ECC engine
might be stronger than requested).

With this addressed, you can add

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

>  	struct spinand_ecc_info eccinfo;
>  	struct {
>  		const struct spinand_op_variants *read_cache;
Miquel Raynal Jan. 16, 2020, 8:53 a.m. UTC | #2
Hi Boris,

Boris Brezillon <boris.brezillon@collabora.com> wrote on Sat, 12 Oct
2019 11:35:30 +0200:

> On Thu, 19 Sep 2019 21:31:12 +0200
> Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> 
> > Prepare the migration to a generic ECC engine by renaming the
> > nand_ecc_req structure into nand_ecc_props. This structure will be the
> > base of a wider 'nand_ecc' structure.
> > 
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > ---
> >  include/linux/mtd/nand.h    | 8 ++++----
> >  include/linux/mtd/spinand.h | 2 +-
> >  2 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> > index 531c1799bf2c..7072f14239e5 100644
> > --- a/include/linux/mtd/nand.h
> > +++ b/include/linux/mtd/nand.h
> > @@ -128,11 +128,11 @@ struct nand_page_io_req {
> >  };
> >  
> >  /**
> > - * struct nand_ecc_req - NAND ECC requirements
> > + * struct nand_ecc_props - NAND ECC properties
> >   * @strength: ECC strength
> > - * @step_size: ECC step/block size
> > + * @step_size: Number of bytes per step
> >   */
> > -struct nand_ecc_req {
> > +struct nand_ecc_props {
> >  	unsigned int strength;
> >  	unsigned int step_size;
> >  };
> > @@ -191,7 +191,7 @@ struct nand_ops {
> >  struct nand_device {
> >  	struct mtd_info mtd;
> >  	struct nand_memory_organization memorg;
> > -	struct nand_ecc_req eccreq;
> > +	struct nand_ecc_props eccreq;  
> 
> Let's rename this field too: s/eccreq/eccprops/

This is just a transition step, this field is being replaced by a much
wider structure two patches later. The impact of renaming this field is
huge compared to its interest so I'd prefer not to do it.

Miquèl
Boris Brezillon Jan. 16, 2020, 9:12 a.m. UTC | #3
On Thu, 16 Jan 2020 09:53:01 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Hi Boris,
> 
> Boris Brezillon <boris.brezillon@collabora.com> wrote on Sat, 12 Oct
> 2019 11:35:30 +0200:
> 
> > On Thu, 19 Sep 2019 21:31:12 +0200
> > Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >   
> > > Prepare the migration to a generic ECC engine by renaming the
> > > nand_ecc_req structure into nand_ecc_props. This structure will be the
> > > base of a wider 'nand_ecc' structure.
> > > 
> > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > > ---
> > >  include/linux/mtd/nand.h    | 8 ++++----
> > >  include/linux/mtd/spinand.h | 2 +-
> > >  2 files changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> > > index 531c1799bf2c..7072f14239e5 100644
> > > --- a/include/linux/mtd/nand.h
> > > +++ b/include/linux/mtd/nand.h
> > > @@ -128,11 +128,11 @@ struct nand_page_io_req {
> > >  };
> > >  
> > >  /**
> > > - * struct nand_ecc_req - NAND ECC requirements
> > > + * struct nand_ecc_props - NAND ECC properties
> > >   * @strength: ECC strength
> > > - * @step_size: ECC step/block size
> > > + * @step_size: Number of bytes per step
> > >   */
> > > -struct nand_ecc_req {
> > > +struct nand_ecc_props {
> > >  	unsigned int strength;
> > >  	unsigned int step_size;
> > >  };
> > > @@ -191,7 +191,7 @@ struct nand_ops {
> > >  struct nand_device {
> > >  	struct mtd_info mtd;
> > >  	struct nand_memory_organization memorg;
> > > -	struct nand_ecc_req eccreq;
> > > +	struct nand_ecc_props eccreq;    
> > 
> > Let's rename this field too: s/eccreq/eccprops/  
> 
> This is just a transition step, this field is being replaced by a much
> wider structure two patches later. The impact of renaming this field is
> huge compared to its interest so I'd prefer not to do it.

Fair enough. I guess it's no longer named eccreq after the transition.
diff mbox series

Patch

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 531c1799bf2c..7072f14239e5 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -128,11 +128,11 @@  struct nand_page_io_req {
 };
 
 /**
- * struct nand_ecc_req - NAND ECC requirements
+ * struct nand_ecc_props - NAND ECC properties
  * @strength: ECC strength
- * @step_size: ECC step/block size
+ * @step_size: Number of bytes per step
  */
-struct nand_ecc_req {
+struct nand_ecc_props {
 	unsigned int strength;
 	unsigned int step_size;
 };
@@ -191,7 +191,7 @@  struct nand_ops {
 struct nand_device {
 	struct mtd_info mtd;
 	struct nand_memory_organization memorg;
-	struct nand_ecc_req eccreq;
+	struct nand_ecc_props eccreq;
 	struct nand_row_converter rowconv;
 	struct nand_bbt bbt;
 	const struct nand_ops *ops;
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 4ea558bd3c46..fad19058e28f 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -294,7 +294,7 @@  struct spinand_info {
 	u16 devid;
 	u32 flags;
 	struct nand_memory_organization memorg;
-	struct nand_ecc_req eccreq;
+	struct nand_ecc_props eccreq;
 	struct spinand_ecc_info eccinfo;
 	struct {
 		const struct spinand_op_variants *read_cache;