From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Date: Thu, 26 Nov 2009 13:18:22 -0600 Subject: [U-Boot] [PATCH V2] arm/board.c: avoid ifdef using weak default functions In-Reply-To: References: <20091126083503.GA13581@mail.gnudd.com> Message-ID: <4B0ED47E.7070608@windriver.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Joakim Tjernlund wrote: >> From: Alessandro Rubini >> >> While it's a matter of personal taste, I prefer to avoid ifdef when >> possible. For example, I don't like to add BOARD_LATE_INIT in the >> config file just to add a board_late_init() function. >> Also, I think the file is more readable without the ifdef stuff. >> This uses two trivial weak functions to provide defaults for all >> functions that were ifdeffed. >> >> This patch was initially rejected in favor of a initcall mechanism >> but that approach is not a work in progress any ore. >> --- >> >> One complaint I got about this is the runtime overhead. Actually, >> normal_nop is two instructions (plus the call to it) and void_nop >> is one instruction (plus the call), similar to the overhead in >> led management for platforms with no leds. > > I think (I have proposed this before) that you should get rid of > the init_fnc_t *init_sequence[] array all together. It only > adds relocation overhead(lots of it). Just make the array a function > that calls the init functions directly. > Please resend the RFC patch. This would also go the arm/testing-arm_init branch. I am interested in flexibility and maintainability. Not so much on size. Tom > Jocke > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot