From: Wolfgang Denk Date: Sun, 03 May 2009 15:23:28 +0200 Subject: [U-Boot] [PATCH 1/1] arm: clean sizes.h In-Reply-To: <20090502215903.894E783420E8@gemini.denx.de> References: <1241219918-22846-1-git-send-email-plagnioj@jcrosoft.com> <20090502183211.4361F83420E8@gemini.denx.de> <20090502194009.GK25959@game.jcrosoft.org> <20090502215903.894E783420E8@gemini.denx.de> Message-ID: <20090503132328.8EC7983420E8@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Jean-Christophe, in message <20090502215903.894E783420E8@gemini.denx.de> I wrote: > > > Actually For ARM we ask us tp use it so to simplify the import from linux > > this "helper" are also imported > > I don't know who "we" is, but you don;t have my ACK for this, and as > long as it's not even correct youwill not get it. > > > > > #define SZ_1K 0x00000400 > > > > #define SZ_4K 0x00001000 > > > > #define SZ_8K 0x00002000 > > > > > > Please keep in mind that "K", "M", and "G" are non-standard prefixes, > > > and it is not clear if they refer to decimal or binary multiples. > > > This makes their use in the code a PITA. Situation is even worse, if you check existing U-Boot code; for example: "include/asm-arm/sizes.h": #define SZ_1K 0x00000400 #define SZ_4K 0x00001000 #define SZ_8K 0x00002000 #define SZ_16K 0x00004000 #define SZ_64K 0x00010000 #define SZ_128K 0x00020000 #define SZ_256K 0x00040000 #define SZ_512K 0x00080000 #define SZ_1M 0x00100000 #define SZ_2M 0x00200000 #define SZ_4M 0x00400000 #define SZ_8M 0x00800000 #define SZ_16M 0x01000000 #define SZ_32M 0x02000000 #define SZ_64M 0x04000000 #define SZ_128M 0x08000000 #define SZ_256M 0x10000000 "board/amcc/taishan/init.S", "board/amcc/yosemite/init.S", "board/pcs440ep/init.S", "board/prodrive/alpr/init.S", "board/prodrive/p3p440/init.S" and many more: #define SZ_1K 0x00000000 #define SZ_4K 0x00000010 #define SZ_16K 0x00000020 #define SZ_64K 0x00000030 #define SZ_256K 0x00000040 #define SZ_1M 0x00000050 #define SZ_8M 0x00000060 #define SZ_16M 0x00000070 #define SZ_256M 0x00000090 So what is the "easy to read and understand" ``helper'' SZ_1M ? Is it 1,000,000 or 1,048,576 or ist it eventually just 80 ? These defines are no ``helpers'', they are Faux Ami, and we should start to expunge this crap as soon as possible. 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 ######## This message was made from 100% recycled electrons. ########