[U-Boot] [PATCH v4 6/9] Create a single cmd_call() function to handle command execution

Simon Glass sjg at chromium.org
Tue Feb 14 23:38:29 CET 2012


Hi Mike,

On Sat, Feb 4, 2012 at 7:22 PM, Mike Frysinger <vapier at gentoo.org> wrote:

> On Saturday 14 January 2012 01:45:54 Simon Glass wrote:
> > --- a/common/command.c
> > +++ b/common/command.c
> >
> > +int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> > +{
> > +     int result;
> > +
> > +     result = (cmdtp->cmd)(cmdtp, flag, argc, argv);
> > +     if (result)
> > +             debug("Command failed, result=%d", result);
> > +     return result;
> > +}
>
> does a static inline in the header produce the same code size or better ?
>

It doesn't really matter - this function becomes static in a later patch.
The common code is teased out of hush and main in two separate commits,
since otherwise it gets very confusing.


>
> > --- a/include/command.h
> > +++ b/include/command.h
> >
> > +#ifndef      __ASSEMBLY__
> > +int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
> > +#endif       /* __ASSEMBLY__ */
>
> move the prototype up to the rest of the !ASSEMBLY code rather than
> putting it
> at the end by itself ?
> -mike
>

Will do.

Regards,
Simon


More information about the U-Boot mailing list