From: Jean-Christophe PLAGNIOL-VILLARD Date: Tue, 18 Aug 2009 00:53:54 +0200 Subject: [U-Boot] [PATCH v2] arm: Kirkwood: add SYSRSTn Duration Counter Support In-Reply-To: <20090817223630.0F0C9833DBD2@gemini.denx.de> References: <1249662782-13333-1-git-send-email-prafulla@marvell.com> <20090817221152.GM23695@game.jcrosoft.org> <20090817223630.0F0C9833DBD2@gemini.denx.de> Message-ID: <20090817225354.GC4309@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 00:36 Tue 18 Aug , Wolfgang Denk wrote: > Dear Jean-Christophe PLAGNIOL-VILLARD, > > In message <20090817221152.GM23695@game.jcrosoft.org> you wrote: > > > > > + printf("Starting %s process...\n", __FUNCTION__); > > > + sprintf(cmd, "run "); > > > + sprintf(img, "sysrstcmd"); > > > + argv[0] = cmd; > > > + argv[1] = img; > > > + if ((do_run(NULL, 0, 2, argv)) != 0x0) { > > > + printf("Error.. %s failed\n", __FUNCTION__); > > > + } else { > > > + printf("%s process finished\n", __FUNCTION__); > > > + } > > > > > +#else /* CONFIG_CMD_RUN */ > > > + printf("Error.. %s needs run command support\n", __FUNCTION__); > > > +#endif /* CONFIG_CMD_RUN */ > > why not replace this by > > > > char *s = getenv("sysrstcmd"); > > > > if (!s) { > > printf("Error.. %s failed, check sysrstcmd\n", > > __FUNCTION__); > > return; > > } > > > > printf("Starting %s process...\n", __FUNCTION__); > > #if !defined(CONFIG_SYS_HUSH_PARSER) > > ret = run_command (s, 0); > > #else > > ret = parse_string_outer(s, FLAG_PARSE_SEMICOLON > > | FLAG_EXIT_FROM_LOOP); > > #endif > > Maybe because the original code does not need an #ifdef ? but the size is bigger on the current implementation and as we have this is other part of U-Boot we can add a inline to have the ifdef at only one place Best Regards, J.