All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Question: is SZ_* going to be removed or not?
@ 2011-01-26  8:28 Reinhard Meyer
  2011-01-26  9:20 ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: Reinhard Meyer @ 2011-01-26  8:28 UTC (permalink / raw)
  To: u-boot

Hello Wolfgang,

I heard rumors that the SZ_* defines are going to be outphased.

If so, new submissions should not use them anymore, right?

Best Regards,
Reinhard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Question: is SZ_* going to be removed or not?
  2011-01-26  8:28 [U-Boot] Question: is SZ_* going to be removed or not? Reinhard Meyer
@ 2011-01-26  9:20 ` Wolfgang Denk
  2011-01-26  9:29   ` Eric Bénard
  2011-01-26  9:43   ` Reinhard Meyer
  0 siblings, 2 replies; 6+ messages in thread
From: Wolfgang Denk @ 2011-01-26  9:20 UTC (permalink / raw)
  To: u-boot

Dear Reinhard Meyer,

In message <4D3FDB14.6060004@emk-elektronik.de> you wrote:
> 
> I heard rumors that the SZ_* defines are going to be outphased.

I's on my personal hate list, indeed.

> If so, new submissions should not use them anymore, right?

Right.

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
When you die, the first thing you lose is your life. The  next  thing
is the illusions.                       - Terry Pratchett, _Pyramids_

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Question: is SZ_* going to be removed or not?
  2011-01-26  9:20 ` Wolfgang Denk
@ 2011-01-26  9:29   ` Eric Bénard
  2011-01-26  9:43     ` Wolfgang Denk
  2011-01-26  9:43   ` Reinhard Meyer
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Bénard @ 2011-01-26  9:29 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On 26/01/2011 10:20, Wolfgang Denk wrote:
 > In message<4D3FDB14.6060004@emk-elektronik.de>  you wrote:
 >>
 >> I heard rumors that the SZ_* defines are going to be outphased.
 >
 > I's on my personal hate list, indeed.
 >
 >> If so, new submissions should not use them anymore, right?
 >
 > Right.
 >
so what is the recommended way to write size ?

Thanks,
Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Question: is SZ_* going to be removed or not?
  2011-01-26  9:20 ` Wolfgang Denk
  2011-01-26  9:29   ` Eric Bénard
@ 2011-01-26  9:43   ` Reinhard Meyer
  2011-01-26 12:59     ` Wolfgang Denk
  1 sibling, 1 reply; 6+ messages in thread
From: Reinhard Meyer @ 2011-01-26  9:43 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang Denk,
> Dear Reinhard Meyer,
> 
> In message <4D3FDB14.6060004@emk-elektronik.de> you wrote:
>>
>> I heard rumors that the SZ_* defines are going to be outphased.
> 
> I's on my personal hate list, indeed.
> 
>> If so, new submissions should not use them anymore, right?
> 
> Right.

OK, I can understand that for having a define for each of the 64 possible values
(1<<0) .. (1<<63) can be annoying.

Will the preffered methods be
xx << 10 for KiB
xx << 20 for MiB
xx << 30 for GiB and so on?

Or might we have a few macros like

#define KiB(x) ((x) << 10)
#define MiB(x) ((x) << 20) and so on?

That would reduce all to about 6 defines.

Best Regards,
Reinhard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Question: is SZ_* going to be removed or not?
  2011-01-26  9:29   ` Eric Bénard
@ 2011-01-26  9:43     ` Wolfgang Denk
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2011-01-26  9:43 UTC (permalink / raw)
  To: u-boot

Dear =?ISO-8859-1?Q?Eric_B=E9nard?=,

In message <4D3FE967.7050708@eukrea.com> you wrote:
>
> so what is the recommended way to write size ?

In a readable way.

If you need 2k, write it as 2000 or 2*1000 or similar.

If you need 2 Ki, write it as 2048 or 2*1024 or (2 << 10) or similar.


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@denx.de
Q:  What's a light-year?
A:  One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Question: is SZ_* going to be removed or not?
  2011-01-26  9:43   ` Reinhard Meyer
@ 2011-01-26 12:59     ` Wolfgang Denk
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2011-01-26 12:59 UTC (permalink / raw)
  To: u-boot

Dear Reinhard Meyer,

In message <4D3FECB2.1010007@emk-elektronik.de> you wrote:
>
> Will the preffered methods be
> xx << 10 for KiB
> xx << 20 for MiB
> xx << 30 for GiB and so on?

Please note that the binary prefixes kibi and mebi not might be used
for other things than bytes as well. And if we were trying to be
precise, wie might want to use "octets" instead of bytes anyway ;-)

I think it's largely a matter of taste and experience whether you
prefer (2 << 30) or (2 * 1024 * 1024 * 1024). It depends a lot on how
much you work with such numbers - I prefer (2 << 30) because it's
shorter, others find the "* 1024" notation easier to read.

But no matter what you prefer -@least both variants are readable.

> Or might we have a few macros like
> 
> #define KiB(x) ((x) << 10)
> #define MiB(x) ((x) << 20) and so on?

Why should we use any such macros at all? Just write the plain
numbers in the code so everybody can understand it without having to
look up the definition.

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@denx.de
Severe culture shock results when experts from another protocol suite
[...] try to read OSI documents. The term "osified" is used to  refer
to  such  documents. [...] Any relationship to the word "ossified" is
purely intentional.                                - Marshall T. Rose

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-26 12:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-26  8:28 [U-Boot] Question: is SZ_* going to be removed or not? Reinhard Meyer
2011-01-26  9:20 ` Wolfgang Denk
2011-01-26  9:29   ` Eric Bénard
2011-01-26  9:43     ` Wolfgang Denk
2011-01-26  9:43   ` Reinhard Meyer
2011-01-26 12:59     ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.