From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Tue, 08 Sep 2009 16:07:39 -0400 Subject: [U-Boot] [PATCH] TI DaVinci: Remove references to SZ_xx In-Reply-To: <17434f2e0909081228g626feae2s1bac3bbcedabd2c6@mail.gmail.com> References: <1252434246-19517-1-git-send-email-s-paulraj@ti.com> <20090908185057.CDC1A832E8DE@gemini.denx.de> <0554BEF07D437848AF01B9C9B5F0BC5D925680C6@dlee01.ent.ti.com> <4AA6ABF7.5060709@windriver.com> <17434f2e0909081214tf30f005tb4f1086461198e7a@mail.gmail.com> <0554BEF07D437848AF01B9C9B5F0BC5D9256816F@dlee01.ent.ti.com> <17434f2e0909081228g626feae2s1bac3bbcedabd2c6@mail.gmail.com> Message-ID: <4AA6B98B.2040502@ge.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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: 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]