[U-Boot] [PATCH v2] arm: Kirkwood: add SYSRSTn Duration Counter Support
Wolfgang Denk
wd at denx.de
Tue Aug 18 00:36:30 CEST 2009
Dear Jean-Christophe PLAGNIOL-VILLARD,
In message <20090817221152.GM23695 at 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 ?
Best regards,
Wolfgang Denk
--
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
In the beginning there was nothing.
And the Lord said "Let There Be Light!"
And still there was nothing, but at least now you could see it.
More information about the U-Boot
mailing list