[v2,09/25] mtd: nand: qcom: remove memset for clearing read register buffer
diff mbox

Message ID 1500464893-11352-10-git-send-email-absahu@codeaurora.org
State Accepted
Delegated to: Boris Brezillon
Headers show

Commit Message

Abhishek Sahu July 19, 2017, 11:47 a.m. UTC
The memset in clear_read_regs is overhead. All the register data
will be filled by DMA during NAND operation so making these
register variables zero is not required.

Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
---
 drivers/mtd/nand/qcom_nandc.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Archit Taneja Aug. 2, 2017, 6:06 a.m. UTC | #1
On 07/19/2017 05:17 PM, Abhishek Sahu wrote:
> The memset in clear_read_regs is overhead. All the register data
> will be filled by DMA during NAND operation so making these
> register variables zero is not required.

Yeah, that's a good point.

Reviewed-by: Archit Taneja <architt@codeaurora.org>

> 
> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> ---
>   drivers/mtd/nand/qcom_nandc.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c
> index 5b71478..7ecd0f8 100644
> --- a/drivers/mtd/nand/qcom_nandc.c
> +++ b/drivers/mtd/nand/qcom_nandc.c
> @@ -826,8 +826,6 @@ static void free_descs(struct qcom_nand_controller *nandc)
>   static void clear_read_regs(struct qcom_nand_controller *nandc)
>   {
>   	nandc->reg_read_pos = 0;
> -	memset(nandc->reg_read_buf, 0,
> -	       MAX_REG_RD * sizeof(*nandc->reg_read_buf));
>   }
>   
>   static void pre_command(struct qcom_nand_host *host, int command)
>
Boris Brezillon Aug. 4, 2017, 7:48 a.m. UTC | #2
On Wed, 19 Jul 2017 17:17:57 +0530
Abhishek Sahu <absahu@codeaurora.org> wrote:

> The memset in clear_read_regs is overhead. All the register data
> will be filled by DMA during NAND operation so making these
> register variables zero is not required.
> 

Applied.

Thanks,

Boris

> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> ---
>  drivers/mtd/nand/qcom_nandc.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c
> index 5b71478..7ecd0f8 100644
> --- a/drivers/mtd/nand/qcom_nandc.c
> +++ b/drivers/mtd/nand/qcom_nandc.c
> @@ -826,8 +826,6 @@ static void free_descs(struct qcom_nand_controller *nandc)
>  static void clear_read_regs(struct qcom_nand_controller *nandc)
>  {
>  	nandc->reg_read_pos = 0;
> -	memset(nandc->reg_read_buf, 0,
> -	       MAX_REG_RD * sizeof(*nandc->reg_read_buf));
>  }
>  
>  static void pre_command(struct qcom_nand_host *host, int command)

Patch
diff mbox

diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c
index 5b71478..7ecd0f8 100644
--- a/drivers/mtd/nand/qcom_nandc.c
+++ b/drivers/mtd/nand/qcom_nandc.c
@@ -826,8 +826,6 @@  static void free_descs(struct qcom_nand_controller *nandc)
 static void clear_read_regs(struct qcom_nand_controller *nandc)
 {
 	nandc->reg_read_pos = 0;
-	memset(nandc->reg_read_buf, 0,
-	       MAX_REG_RD * sizeof(*nandc->reg_read_buf));
 }
 
 static void pre_command(struct qcom_nand_host *host, int command)