[U-Boot] Question: is SZ_* going to be removed or not?

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

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

Hi Wolfgang,
On 26/01/2011 10:20, Wolfgang Denk wrote:
In message4D3FDB14.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

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

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

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 - at 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
participants (3)
-
Eric Bénard
-
Reinhard Meyer
-
Wolfgang Denk