From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alessandro Rubini Date: Sun, 1 May 2011 22:28:17 +0200 Subject: [U-Boot] [PATCH 2/3] arm: omap: innovator: Prepare for mach-types.h changes In-Reply-To: <1304244632-8714-2-git-send-email-grinberg@compulab.co.il> References: <1304244632-8714-2-git-send-email-grinberg@compulab.co.il> Message-ID: <20110501202817.GA17779@mail.gnudd.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de I'm sorry for sounding rude, it's not my intention. I didn't follow closely the discussion about mach_types.h, but I think we are heading in the wrong direction. For example, this patch: > - if (machine_is_omap_h2()) > - gd->bd->bi_arch_number = MACH_TYPE_OMAP_H2; > - else if (machine_is_omap_innovator()) > - gd->bd->bi_arch_number = MACH_TYPE_OMAP_INNOVATOR; > - else > - gd->bd->bi_arch_number = MACH_TYPE_OMAP_GENERIC; > +#if defined(CONFIG_MACH_OMAP_H2) > + gd->bd->bi_arch_number = MACH_TYPE_OMAP_H2; > +#elif defined(CONFIG_MACH_OMAP_INNOVATOR) > + gd->bd->bi_arch_number = MACH_TYPE_OMAP_INNOVATOR; > +#else > + gd->bd->bi_arch_number = MACH_TYPE_OMAP_GENERIC; > +#endif Since when turning if into ifdef has been a wise move for maintainability? The commis says: > This board used machine_is_* macros for identifying the arch number. > Use compile time defines instead. But this already was compile-time: no code generated. But even if it generated code, I prefer 3 run-time comparisons than 3 compile-time ifdefs. Note that mach_types.h, as designed by Russell King, already had compile time selection, becuase if you selected one machine only (like in u-boot), one of the "if" becomes compile-time-true and the other ones become "0". I see a lot of discussion about checkpatch compliance and cleanup-only patches are being accepted; this goes in the opposite direction, for no reason apparent to me. thanks for your patience /alessandro