diff mbox series

[nand-next,v2] mtd: rawnand: gpmi: remove unneeded variable

Message ID 20211213104930.436602-1-chi.minghao@zte.com.cn
State Changes Requested
Headers show
Series [nand-next,v2] mtd: rawnand: gpmi: remove unneeded variable | expand

Commit Message

CGEL Dec. 13, 2021, 10:49 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn>

Return status directly from function called.
change since v1: mtd/nand:remove unneeded variable
             v2: mtd: rawnand: gpmi: remove unneeded variable

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Miquel Raynal Dec. 13, 2021, 11 a.m. UTC | #1
Hello,

cgel.zte@gmail.com wrote on Mon, 13 Dec 2021 10:49:30 +0000:

> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Return status directly from function called.
> change since v1: mtd/nand:remove unneeded variable
>              v2: mtd: rawnand: gpmi: remove unneeded variable

Thanks for providing a changelog, this is indeed the right thing to do.
However it should not be part of the commit message and hence not be
located here...

> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---

... but here!

Anything below these three dashes '---' will be ignored by Git.

>  drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> index 10cc71829dcb..ab9d1099bafa 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> @@ -1425,7 +1425,6 @@ static int gpmi_ecc_write_page(struct nand_chip *chip, const uint8_t *buf,
>  	struct mtd_info *mtd = nand_to_mtd(chip);
>  	struct gpmi_nand_data *this = nand_get_controller_data(chip);
>  	struct bch_geometry *nfc_geo = &this->bch_geometry;
> -	int ret;
>  
>  	dev_dbg(this->dev, "ecc write page.\n");
>  
> @@ -1445,9 +1444,7 @@ static int gpmi_ecc_write_page(struct nand_chip *chip, const uint8_t *buf,
>  				    this->auxiliary_virt);
>  	}
>  
> -	ret = nand_prog_page_op(chip, page, 0, buf, nfc_geo->page_size);
> -
> -	return ret;
> +	return nand_prog_page_op(chip, page, 0, buf, nfc_geo->page_size);
>  }
>  
>  /*


Thanks,
Miquèl
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index 10cc71829dcb..ab9d1099bafa 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -1425,7 +1425,6 @@  static int gpmi_ecc_write_page(struct nand_chip *chip, const uint8_t *buf,
 	struct mtd_info *mtd = nand_to_mtd(chip);
 	struct gpmi_nand_data *this = nand_get_controller_data(chip);
 	struct bch_geometry *nfc_geo = &this->bch_geometry;
-	int ret;
 
 	dev_dbg(this->dev, "ecc write page.\n");
 
@@ -1445,9 +1444,7 @@  static int gpmi_ecc_write_page(struct nand_chip *chip, const uint8_t *buf,
 				    this->auxiliary_virt);
 	}
 
-	ret = nand_prog_page_op(chip, page, 0, buf, nfc_geo->page_size);
-
-	return ret;
+	return nand_prog_page_op(chip, page, 0, buf, nfc_geo->page_size);
 }
 
 /*