From: Mike Frysinger Date: Sat, 13 Jun 2009 11:13:50 -0400 Subject: [U-Boot] [patch] rm9200 ethernet driver: board-specific quirk?(csb337) In-Reply-To: <20090613145439.GG25406@game.jcrosoft.org> References: <200906091114.24166.david-b@pacbell.net> <200906131050.16471.vapier@gentoo.org> <20090613145439.GG25406@game.jcrosoft.org> Message-ID: <200906131113.51509.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday 13 June 2009 10:54:39 Jean-Christophe PLAGNIOL-VILLARD wrote: > On 10:50 Sat 13 Jun , Mike Frysinger wrote: > > On Saturday 13 June 2009 08:28:23 Jean-Christophe PLAGNIOL-VILLARD wrote: > > > On 04:13 Sat 13 Jun , David Brownell wrote: > > > > On Saturday 13 June 2009, Jean-Christophe PLAGNIOL-VILLARD wrote: > > > > > > The machine_is_X() macros are automatically #ifdeffed in > > > > > > the header; no size impact. Read ... > > > > > > > > > > If I use this pacth on the rm9200ek the u-boot.bin size will > > > > > increase for nothing > > > > > > > > I'm not following you. The lines are: > > > > > > > > > > > > #ifdef CONFIG_MACH_CSB337 > > > > # ifdef machine_arch_type > > > > # undef machine_arch_type > > > > # define machine_arch_type __machine_arch_type > > > > # else > > > > # define machine_arch_type MACH_TYPE_CSB337 > > > > # endif > > > > # define machine_is_csb337() (machine_arch_type == > > > > MACH_TYPE_CSB337) #else > > > > # define machine_is_csb337() (0) > > > > #endif > > > > > > > > ... and similar for EK. The csb337 config file sets > > > > CONFIG_MACH_CSB337, and nothing else does. Result: on rm9200ek, > > > > that test becomes if(0), while on csb337 it becomes if (X == X), > > > > where X == MACH_TYPE_CSB337. > > > > > > > > > If I was able to detect dynamicly on which board I will run ok > > > > > but it's not the case here > > > > > so please use > > > > > #ifdef CONFIG_MACH_xxx > > > > > #else > > > > > #endif > > > > > > > > See above. There already *IS* such an #ifdef, but it's just not > > > > cluttering up the guts of that driver. > > > > > > you adding MUST have NO size impact on other board > > > > > > if we apply you code as it we will increase the size of u-boot for > > > every rm9200 board that use the ethernet > > > > i dont get it. the CPP expands into if(0) and unless you have a > > completely shitty compiler, gcc will do dead code elimination on it > > resulting in the same binary size. > > I've seen to much "shitty version" that does not do it correctly > so I prefer ot avoid the problem i'm pretty sure we're already relying on this behavior. so you've got a bigger problem that needs addressing (i.e. shit can that compiler) than what David is proposing. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20090613/79242da8/attachment.pgp