[U-Boot] [PATCH] TI DaVinci: Remove references to SZ_xx
J.C. Wren
jcwren at jcwren.com
Tue Sep 8 22:12:08 CEST 2009
On Tue, Sep 8, 2009 at 4:07 PM, Jerry Van Baren <gerald.vanbaren at ge.com>wrote:
> J.C. Wren wrote:
>
>> I saw this comment: "Also i gather from e-mails on the list that Wolfgang
>> does not like these references to "SZ_xx". Maybe that discussion took
>> place
>> before I joined the list.
>>
>> If he wants it that way, fine. But that doesn't explain the "why".
>> What's
>> so offensive about the SZ_* defines?
>>
>> --jc
>>
>
> Hi J.C.,
>
> The SZ_* defines turns a simple math problem into a two finger problem...
> every time you see them, you need to put your finger in the code and look
> them up, only to find (1 << n), have to stick a second finger in the code,
> and have to do the math anyway.
>
> One REALLY BAD problem is that idiots have been known to mis-define them
> rather than fix the code that uses them (seriously!). By using (1 << 20)
> directly, it removes that temptation.
>
> A lesser problem is that they don't do anything, you still have to figure
> out that 1 << 20 is 1MiB. All they do is defer the pain.
>
> You will also find other silliness, e.g. generating SZ_31M:
> <http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/27048/focus=27139>
> This silliness is the road to insanity: SZ_30M and SZ_29M and SZ_28.125M.
> (OK, I exaggerated on that last one. It would actually be SZ_28_125M.)
>
> HTH,
> gvb
>
> [snip]
>
Excellent explanation. Thank you.
I do like this (from the email link): (31 * 1024 * 1024). And it appears
not to give Wolfgang indigestion :)
--jc
More information about the U-Boot
mailing list