diff mbox series

[v3,13/40] mtd: nand: Add more parameters to the nand_ecc_props structure

Message ID 20190919193141.7865-14-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 the generic ECC framework by adding more
fields to the nand_ecc_props structure which will be used widely to
describe different kind of ECC properties.

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

Comments

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

> Prepare the migration to the generic ECC framework by adding more
> fields to the nand_ecc_props structure which will be used widely to
> describe different kind of ECC properties.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  include/linux/mtd/nand.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> index 7072f14239e5..11cd7cc81a7a 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -129,12 +129,20 @@ struct nand_page_io_req {
>  
>  /**
>   * struct nand_ecc_props - NAND ECC properties
> + * @provider: ECC engine provider type
> + * @placement: OOB placement (if relevant)
> + * @algo: ECC algorithm (if relevant)
>   * @strength: ECC strength
>   * @step_size: Number of bytes per step
> + * @flags: Misc properties
>   */
>  struct nand_ecc_props {
> +	unsigned int provider;
> +	unsigned int placement;
> +	unsigned int algo;

Hm, we should have enums here, and it's better to introduce the
provider/placement/algo definitions along with the fields.

>  	unsigned int strength;
>  	unsigned int step_size;
> +	unsigned int flags;
>  };
>  
>  #define NAND_ECCREQ(str, stp) { .strength = (str), .step_size = (stp) }
Miquel Raynal Jan. 16, 2020, 8:59 a.m. UTC | #2
Hi Boris,

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

> On Thu, 19 Sep 2019 21:31:13 +0200
> Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> 
> > Prepare the migration to the generic ECC framework by adding more
> > fields to the nand_ecc_props structure which will be used widely to
> > describe different kind of ECC properties.
> > 
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > ---
> >  include/linux/mtd/nand.h | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> > index 7072f14239e5..11cd7cc81a7a 100644
> > --- a/include/linux/mtd/nand.h
> > +++ b/include/linux/mtd/nand.h
> > @@ -129,12 +129,20 @@ struct nand_page_io_req {
> >  
> >  /**
> >   * struct nand_ecc_props - NAND ECC properties
> > + * @provider: ECC engine provider type
> > + * @placement: OOB placement (if relevant)
> > + * @algo: ECC algorithm (if relevant)
> >   * @strength: ECC strength
> >   * @step_size: Number of bytes per step
> > + * @flags: Misc properties
> >   */
> >  struct nand_ecc_props {
> > +	unsigned int provider;
> > +	unsigned int placement;
> > +	unsigned int algo;  
> 
> Hm, we should have enums here, and it's better to introduce the
> provider/placement/algo definitions along with the fields.

Absolutely! Good catch, this is fixed.

Thanks,
Miquèl
diff mbox series

Patch

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 7072f14239e5..11cd7cc81a7a 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -129,12 +129,20 @@  struct nand_page_io_req {
 
 /**
  * struct nand_ecc_props - NAND ECC properties
+ * @provider: ECC engine provider type
+ * @placement: OOB placement (if relevant)
+ * @algo: ECC algorithm (if relevant)
  * @strength: ECC strength
  * @step_size: Number of bytes per step
+ * @flags: Misc properties
  */
 struct nand_ecc_props {
+	unsigned int provider;
+	unsigned int placement;
+	unsigned int algo;
 	unsigned int strength;
 	unsigned int step_size;
+	unsigned int flags;
 };
 
 #define NAND_ECCREQ(str, stp) { .strength = (str), .step_size = (stp) }