Skip to contentSkip to conversation

cmd_nand: drop duplicate NULL ptr check

PATCH New Mike Frysinger 2 participants 2 messages Apr 13, 2009 – Apr 16, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd_nand: drop duplicate NULL ptr check

The first if statement checks for NULL ptrs, so there is no need to check it again in later else cases (such as .oob).

---
 common/cmd_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_nand.c +1 -1
index e142d76..ff5bc6e 100644
@@ -390,7 +390,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 			else
 				ret = nand_write_skip_bad(nand, off, &size,
 							  (u_char *)addr);
-		} else if (s != NULL && !strcmp(s, ".oob")) {
+		} else if (!strcmp(s, ".oob")) {
 			/* out-of-band data */
 			mtd_oob_ops_t ops = {
 				.oobbuf = (u8 *)addr,
Signature · 1 line
1.6.2.2
#1 lore raw

PATCH 1/1 cmd_nand: drop duplicate NULL ptr check

Dear Mike Frysinger,

Quoted 8 lines · In message <[email protected]> you wrote:

The first if statement checks for NULL ptrs, so there is no need to check it again in later else cases (such as .oob).

---
 common/cmd_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If at first you don't succeed, you are running about average.