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

Simon Glass sjg at chromium.org
Thu Jul 22 15:28:25 CEST 2021


Hi Wolfgang,

On Thu, 22 Jul 2021 at 03:48, Wolfgang Denk <wd at denx.de> wrote:
>
> Dear Simon,
>
> In message <CAPnjgZ0i0BQbP_BOESVazq=1o-2otvKoecVt0n+DrJdkZgrJAg at 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


More information about the U-Boot mailing list