[U-Boot] [PATCH 1/1] arm: clean sizes.h

Wolfgang Denk wd at denx.de
Sat May 2 23:59:03 CEST 2009


Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <20090502194009.GK25959 at game.jcrosoft.org> you wrote:
>
> > Please just remove this. I mean, without attempting to clean it up.
> > 
> > [And not only on ARM, but everywhere.]
> Actually For ARM we ask us tp use it so to simplify the import from linux
> this "helper" are also imported

I don't know who "we" is, but you don;t have my ACK for this, and as
long as it's not even correct youwill not get it.

> > >  #define SZ_1K                           0x00000400
> > >  #define SZ_4K                           0x00001000
> > >  #define SZ_8K                           0x00002000
> > 
> > Please keep in mind that "K", "M", and "G" are non-standard prefixes,
> > and it is not clear if they refer to  decimal  or  binary  multiples.
> > This makes their use in the code a PITA.
> I do not choose it

We can simply chose NOT to use this.

> > Prefixes and symbols for binary multiples  are  standardized  in  IEC
> > 60027-2.  [They  are  not  part  of  the  SI  metric system of units,
> > though.] Correct names for 1024 = (1 << 10), 1024*1024 = ( 1  <<  20)
> > and 1024*1024*1024 = (1 << 30) are "kibi" (kilobinary, abbreviated as
> > "Ki"),  "mebi"  (megabinary,  "Mi"),  and  "gibi" (gigabinary, "Gi"),
> > respective. Note that this is "Ki", not "K".
> I known but it's the linux implementation choice not mine

There is zero need to copy bugs or incorrect code from Linux.

Instead, someone should send patches to fix this in Linux, too (or
better to kill it alltogether).

> > So if you think youmust define something that means 8192, then please
> > name it "8 Ki", as "Ki" is the correct, standardized symbol  for  the
> > name "kibi", meaning "kilobinary".
> Honnestly I think I'll let you try to deal it with Russel

Russel? In case you are referring to RMK you better let not see him
that you misspell his name. He is pretty allergic on this.

Anyway: RMK has zero votes on U-Boot code.


> > With "8 K", nobody ever knows for sure what is meant - is it 8*10**3
> > or is it 8*2**10.
> > 
> > Thus my urgent recommendation: let's get rid of  all  this  ambiguous
> > SZ_*  definitions and use numbers. "8 * 1024" is at least as readable
> > as "SZ_8K", and it leaves no doubt what might be meant.
> To simplify linux import I'll not prefer it

But I insist.

My preference is to get rid of this, but at least fix the bugs before
we use it.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have the simplest tastes.  I am always satisfied with the best.
                                                       -- Oscar Wilde


More information about the U-Boot mailing list