[U-Boot] [PATCH 3/3] net: Be less picky about decoding the netretry env var

Mike Frysinger vapier at gentoo.org
Thu Oct 27 15:40:22 CEST 2011


On Thu, Oct 27, 2011 at 15:35, Simon Glass wrote:
> On Wed, Oct 26, 2011 at 11:00 PM, Mike Frysinger wrote:
>> On Thu, Oct 27, 2011 at 02:18, Simon Glass wrote:
>>> --- a/net/net.c
>>> +++ b/net/net.c
>>>
>>> -               if (!strcmp(nretry, "yes"))
>>> +               if (*nretry == 'y')
>>
>> not sure about this as it makes it hard to add code in the future if
>> we care about compatibility.  if we support just "y", people will
>> start using it.
>
> Yes, I'm not sure either. I have found a few env variables that use
> single letters (autoload, flashchecksum) and noticed that quite a few
> commands only decode as much of their subcommand as they need to be
> unique. I am happier with y and n than o!

right, u-boot is inconsistent

the short command names are a bit unique in that we already say "if
you don't use the full command name, that's your fault".  after all,
how much of the short name you need to use changes based on the
commands enabled and the autocomplete define being enabled.

if you enable "reginfo" and "reset", then you can't use "r" or "re".
but if you only have "reset", then you can use "r" and "re" to reset.

env vars are slightly different in that they're not terribly well
documented.  so people look at the source to see what is accepted and
then do that.  maybe the answer is to document the exact values and
then when people screw up, we can point to that as a fallback.
-mike


More information about the U-Boot mailing list