From: Wolfgang Denk Date: Sat, 18 Sep 2010 21:42:50 +0200 Subject: [U-Boot] [PATCH v3 2/4] mtdparts: show net size in mtdparts list In-Reply-To: References: <1275494319-29010-1-git-send-email-bengardiner@nanometrics.ca> <1278366212-24023-3-git-send-email-bengardiner@nanometrics.ca> <20100807200850.680BDB715A@gemini.denx.de> Message-ID: <20100918194250.0F8C0157D71@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 Ben Gardiner, In message you wrote: > > Would it be acceptable to do something like the following? > > static void print_partition_table(...) > { > #if defined(CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES) > ... > #else /* !defined(CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES) */ > ... > #endif /* defined(CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES) */ > } If the whole body of the funtion is affectted, you better do: #if defined(xxx) static void print_partition_table(...) { ... } #else static void print_partition_table(...) { ... } #endif 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 The alternative to genuflecting before the god of code-bumming is finding a better algorithm. It should be clear that none such was available. If your code is too slow, you must make it faster. If no better algorithm is available, you must trim cycles. - td at alice.UUCP (Tom Duff) 29 Aug 88