[v2,09/36] mtd: rawnand: Clarify the values for invalid ECC mode/algo
diff mbox series

Message ID 20190304222841.13899-10-miquel.raynal@bootlin.com
State New
Headers show
Series
  • Introduce the generic ECC engine abstraction
Related show

Commit Message

Miquel Raynal March 4, 2019, 10:28 p.m. UTC
In the nand_ecc_{mode,algo} enumerations, clarify the fact that the
value 0 will be used for invalid/uninitialized data.

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

Comments

Boris Brezillon March 31, 2019, 11:57 a.m. UTC | #1
On Mon,  4 Mar 2019 23:28:14 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> In the nand_ecc_{mode,algo} enumerations, clarify the fact that the
> value 0 will be used for invalid/uninitialized data.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  include/linux/mtd/rawnand.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> index d25e0c07b0ad..95b0c7114701 100644
> --- a/include/linux/mtd/rawnand.h
> +++ b/include/linux/mtd/rawnand.h
> @@ -88,7 +88,7 @@ struct nand_chip;
>   * Constants for ECC_MODES
>   */
>  enum nand_ecc_mode {
> -	NAND_ECC_INVALID,
> +	NAND_ECC_INVALID = 0,
>  	NAND_ECC_NONE,
>  	NAND_ECC_SOFT,
>  	NAND_ECC_HW,
> @@ -98,7 +98,7 @@ enum nand_ecc_mode {
>  };
>  
>  enum nand_ecc_algo {
> -	NAND_ECC_UNKNOWN,
> +	NAND_ECC_UNKNOWN = 0,
>  	NAND_ECC_HAMMING,
>  	NAND_ECC_BCH,
>  	NAND_ECC_RS,

Do we really need to do that? I think it's pretty common to leave the
first entry unassigned when we want things to start at 0...

Patch
diff mbox series

diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index d25e0c07b0ad..95b0c7114701 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -88,7 +88,7 @@  struct nand_chip;
  * Constants for ECC_MODES
  */
 enum nand_ecc_mode {
-	NAND_ECC_INVALID,
+	NAND_ECC_INVALID = 0,
 	NAND_ECC_NONE,
 	NAND_ECC_SOFT,
 	NAND_ECC_HW,
@@ -98,7 +98,7 @@  enum nand_ecc_mode {
 };
 
 enum nand_ecc_algo {
-	NAND_ECC_UNKNOWN,
+	NAND_ECC_UNKNOWN = 0,
 	NAND_ECC_HAMMING,
 	NAND_ECC_BCH,
 	NAND_ECC_RS,