[U-Boot] [PATCH] cmd/nand.c: Remove unnecessarily repeated step

Ahmed Samir Khalil engkhalil86 at gmail.com
Mon Oct 10 06:44:41 CEST 2016


Getting the current NAND device is already done once as part
 of nand command. Therefore, repeating this step as part of
 the sub-commands is unnecessary.

Signed-off-by: Ahmed Samir Khalil <engkhalil86 at gmail.com>
---
 cmd/nand.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/cmd/nand.c b/cmd/nand.c
index ec7f1df..71ffe85 100644
--- a/cmd/nand.c
+++ b/cmd/nand.c
@@ -528,8 +528,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		if (set_dev(dev))
 			return 1;
 
-		mtd = nand_info[dev];
-
 		memset(&opts, 0, sizeof(opts));
 		opts.offset = off;
 		opts.length = size;
@@ -597,8 +595,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			if (set_dev(dev))
 				return 1;
 
-			mtd = nand_info[dev];
-
 			if (argc > 4 && !str2long(argv[4], &pagecount)) {
 				printf("'%s' is not a number\n", argv[4]);
 				return 1;
@@ -626,8 +622,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			rwsize = size;
 		}
 
-		mtd = nand_info[dev];
-
 		if (!s || !strcmp(s, ".jffs2") ||
 		    !strcmp(s, ".e") || !strcmp(s, ".i")) {
 			if (read)
-- 
2.7.4



More information about the U-Boot mailing list