[PATCH 00/15] lib: Add support for a decimal 0m prefix for numbers

Simon Glass sjg at chromium.org
Wed Jul 21 16:46:03 CEST 2021


Hi Wolfgang,

On Wed, 21 Jul 2021 at 01:53, Wolfgang Denk <wd at denx.de> wrote:
>
> Hi,
>
> In message <20210720160547.GM9379 at bill-the-cat> you wrote:
> >
> > > So for example (10)123 would mean decimal 123? I don't know how we
> > > would parse brackets separately from expressions though.
> >
> > (123)10 would be "123" in decimal.  Which is indeed a mouthful.  But it
> > would also be generic and (123)16 would be 0x123.  So the parsing
> > shouldn't be too hard, for most commands.  But then yes, expressions
> > become quite hard.
>
> Come on, guys, be serious!  This is a boot loader.  Size matters.
>
> Do we _really_ need all this, and is it worth the code size?
>
> Simon's patches include some cleanup, which probably even reduces
> the size, so good.

It reduces U-Boot proper by about 400-700 bytes but not much effect on SPL:

16: RFC: Change simple_strtoul() et al to default to hex
       arm:     evb-ast2500 brppt1_spi brsmarc1
   aarch64: (for 300/301 boards) all -754.8 bss +0.0
spl/u-boot-spl:all -9.9 spl/u-boot-spl:text -9.9 text -754.8
       arc: (for 10/11 boards) all -242.0 text -242.0
       arm: (for 625/627 boards) all -468.7 bss +0.8 data +0.0 rodata
+0.0 spl/u-boot-spl:all -1.5 spl/u-boot-spl:bss -0.1
spl/u-boot-spl:text -1.4 text -469.5
      m68k: (for 18/18 boards) all -499.1 data +11.8 text -510.9
microblaze: (for 1/1 boards) all -392.0 bss +44.0 data +4.0 rodata
-4.0 text -436.0
      mips: (for 43/43 boards) all -457.5 bss +1.1 text -458.6
     nds32: (for 2/2 boards) all -206.0 text -206.0
     nios2: (for 2/2 boards) all -480.0 text -480.0
   powerpc: (for 40/98 boards) all -708.4 text -708.4

>
> But whether it's 0m123 or 0t123 or 0!123 or ... is pretty much
> irrelevant - chose one symbol, use it, and be done with that.

Regards,
Simon


More information about the U-Boot mailing list