[U-Boot] [RFC 2/2 v2] command: Remove maxargs from command structure

Kim Phillips kim.phillips at freescale.com
Fri Mar 12 22:32:21 CET 2010


On Fri, 12 Mar 2010 15:04:49 -0600
John Schmoller <jschmoller at xes-inc.com> wrote:

> On Fri, 2010-03-12 at 14:58 -0600, Kim Phillips wrote:
> > On Fri, 12 Mar 2010 13:25:31 -0600
> > John Schmoller <jschmoller at xes-inc.com> wrote:
> > 
> > > +/*
> > > + * Command Errors:
> > > + */
> > > +#define CMD_ERR_USAGE		256
> > > +
> > 
> > can we just use something like -EINVAL instead of reinventing the error
> > codes wheel?
> 
> The problem with a negative return value, at least as far as I can tell,
> is that hush will print "exit not allowed from main input shell."
> run_list_real() returns -2 if the called functions return is < -1, and
> -2 means exit. If I'm misinterpreting something, let me know.  I don't

maybe I'm missing something too, but it sounds like the
arbitrarily-chosen {-1, -2} error codes commit c26e454d introduced can
be renumerated, just not sure to what though (exit can't be 0?).

> see any problem with using positive EINVAL, though, I didn't notice it
> existed.

I don't see a problem with that either - my main concern here is to not
introduce a new CMD_ERR_ namespace unnecessarily.

Thanks,

Kim


More information about the U-Boot mailing list