mtd: nand: Remove in vain memset() in nand_onfi_get_features()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jun 23 10:59:02 PDT 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=0aec7ac997b784dfc83125cd120d2bd5d3851eb6
Commit:     0aec7ac997b784dfc83125cd120d2bd5d3851eb6
Parent:     666104436543d171b8b1a7213fd1d8bbef1361d5
Author:     Richard Weinberger <richard at nod.at>
AuthorDate: Wed Mar 25 14:33:09 2015 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed May 6 23:44:31 2015 -0700

    mtd: nand: Remove in vain memset() in nand_onfi_get_features()
    
    As all four bytes are written in any case the memset() is in vain.
    
    Signed-off-by: Richard Weinberger <richard at nod.at>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/nand_base.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c2e1232..0afe763 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2928,9 +2928,6 @@ static int nand_onfi_get_features(struct mtd_info *mtd, struct nand_chip *chip,
 	      & ONFI_OPT_CMD_SET_GET_FEATURES))
 		return -EINVAL;
 
-	/* clear the sub feature parameters */
-	memset(subfeature_param, 0, ONFI_SUBFEATURE_PARAM_LEN);
-
 	chip->cmdfunc(mtd, NAND_CMD_GET_FEATURES, addr, -1);
 	for (i = 0; i < ONFI_SUBFEATURE_PARAM_LEN; ++i)
 		*subfeature_param++ = chip->read_byte(mtd);



More information about the linux-mtd-cvs mailing list