Re: [PATCH 13/15] RFC: lib: Support a binary prefix 0y

Simon Glass
2021-07-22T13:28:56Z

Hi Wolfgang,

On Thu, 22 Jul 2021 at 03:48, Wolfgang Denk <wd@denx.de> wrote:
>
> Dear Simon,
>
> In message <CAPnjgZ0i0BQbP_BOESVazq=1o-2otvKoecVt0n+DrJdkZgrJAg@mail.gmail.com> you wrote:
> >
> > > But ... do we really *need* all this stuff?
> >
> > No...
> >
> > I added binary as an RFC because I have found a few cases where it is
> > nice to be able to specify the bits (e.g. programming GPIOs). We could
> > update 'md' to support it too.
>
> Yes, we could, but U-Boot size is continuously growing, even for
> constant configurations, i. e. when no nmew features are
> wanted/needed.

I think in fact my series reduces the size, at least for U-Boot
proper, by 500+ bytes. We could be more aggressive about making even
minor new features optional.

>
> > I added octal as an RFC since the current impl is almost never
> > available (only when 0 is parted to simple_strtoul()) which seems odd.
>
> I can't see how this should work...
>
> > Well, yes. Perhaps we should just drop octal?
>
> Drop? AFAICT we never supported octal. Something like "md 040" will
> start dumping at 0x00000040, right?

There are quite a few places where simple_strtoul() is called with a
base of 0. In that case, if the string starts with 0 it is interpreted
as octal.

Regards,
Simon