Re: [PATCH 4/6] mtd: nand: zynq_nand: Change datatype of status and ecc_status to int

2023-06-12 Thread Michael Nazzareno Trimarchi
Hi

On Fri, Jun 9, 2023 at 11:22 AM Ashok Reddy Soma
 wrote:
>
> From: Algapally Santosh Sagar 
>
> status and ecc_status are of unsigned type where they are compared for
> negative value. This is pointed by below sparse warning. Change datatype
> to int to fix this.
> warning: comparison of unsigned expression in '< 0' is always false
> [-Wtype-limits]
>
> Signed-off-by: Algapally Santosh Sagar 
> Signed-off-by: Ashok Reddy Soma 
> ---
>
>  drivers/mtd/nand/raw/zynq_nand.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/zynq_nand.c 
> b/drivers/mtd/nand/raw/zynq_nand.c
> index 9e3ee7412d..545fdd7b69 100644
> --- a/drivers/mtd/nand/raw/zynq_nand.c
> +++ b/drivers/mtd/nand/raw/zynq_nand.c
> @@ -285,7 +285,7 @@ static int zynq_nand_init_nand_flash(struct mtd_info 
> *mtd, int option)
>  {
> struct nand_chip *nand_chip = mtd_to_nand(mtd);
> struct nand_drv *smc = nand_get_controller_data(nand_chip);
> -   u32 status;
> +   int status;
>
> /* disable interrupts */
> writel(ZYNQ_NAND_CLR_CONFIG, >reg->cfr);
> @@ -332,7 +332,7 @@ static int zynq_nand_calculate_hwecc(struct mtd_info 
> *mtd, const u8 *data,
> struct nand_drv *smc = nand_get_controller_data(nand_chip);
> u32 ecc_value = 0;
> u8 ecc_reg, ecc_byte;
> -   u32 ecc_status;
> +   int ecc_status;
>
> /* Wait till the ECC operation is complete */
> ecc_status = zynq_nand_waitfor_ecc_completion(mtd);
> --

Reviewed-By: Michael Trimarchi 


> 2.17.1
>


[PATCH 4/6] mtd: nand: zynq_nand: Change datatype of status and ecc_status to int

2023-06-09 Thread Ashok Reddy Soma
From: Algapally Santosh Sagar 

status and ecc_status are of unsigned type where they are compared for
negative value. This is pointed by below sparse warning. Change datatype
to int to fix this.
warning: comparison of unsigned expression in '< 0' is always false
[-Wtype-limits]

Signed-off-by: Algapally Santosh Sagar 
Signed-off-by: Ashok Reddy Soma 
---

 drivers/mtd/nand/raw/zynq_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/zynq_nand.c b/drivers/mtd/nand/raw/zynq_nand.c
index 9e3ee7412d..545fdd7b69 100644
--- a/drivers/mtd/nand/raw/zynq_nand.c
+++ b/drivers/mtd/nand/raw/zynq_nand.c
@@ -285,7 +285,7 @@ static int zynq_nand_init_nand_flash(struct mtd_info *mtd, 
int option)
 {
struct nand_chip *nand_chip = mtd_to_nand(mtd);
struct nand_drv *smc = nand_get_controller_data(nand_chip);
-   u32 status;
+   int status;
 
/* disable interrupts */
writel(ZYNQ_NAND_CLR_CONFIG, >reg->cfr);
@@ -332,7 +332,7 @@ static int zynq_nand_calculate_hwecc(struct mtd_info *mtd, 
const u8 *data,
struct nand_drv *smc = nand_get_controller_data(nand_chip);
u32 ecc_value = 0;
u8 ecc_reg, ecc_byte;
-   u32 ecc_status;
+   int ecc_status;
 
/* Wait till the ECC operation is complete */
ecc_status = zynq_nand_waitfor_ecc_completion(mtd);
-- 
2.17.1