From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] TI DaVinci: Remove references to SZ_xx
Date: Tue, 08 Sep 2009 16:07:39 -0400 [thread overview]
Message-ID: <4AA6B98B.2040502@ge.com> (raw)
In-Reply-To: <17434f2e0909081228g626feae2s1bac3bbcedabd2c6@mail.gmail.com>
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]
next prev parent reply other threads:[~2009-09-08 20:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-08 18:24 [U-Boot] [PATCH] TI DaVinci: Remove references to SZ_xx s-paulraj at ti.com
2009-09-08 18:50 ` Wolfgang Denk
2009-09-08 18:56 ` Paulraj, Sandeep
2009-09-08 19:04 ` Paulraj, Sandeep
2009-09-08 20:34 ` Wolfgang Denk
2009-09-08 19:09 ` Tom
2009-09-08 19:14 ` J.C. Wren
2009-09-08 19:20 ` Paulraj, Sandeep
2009-09-08 19:28 ` J.C. Wren
2009-09-08 19:38 ` Paulraj, Sandeep
2009-09-08 20:07 ` Jerry Van Baren [this message]
2009-09-08 20:12 ` J.C. Wren
2009-09-08 20:41 ` Wolfgang Denk
2009-09-08 21:13 ` Jerry Van Baren
2009-09-08 21:21 ` Wolfgang Denk
2009-09-09 2:45 ` Jerry Van Baren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AA6B98B.2040502@ge.com \
--to=gerald.vanbaren@ge.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox