From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 06 Nov 2013 09:30:53 +0100 Subject: [U-Boot] [PATCH v4 0/8] Provide a mechanism to avoid using #ifdef everywhere In-Reply-To: <20131106072444.055753811E0@gemini.denx.de> References: <1382800457-26608-1-git-send-email-sjg@chromium.org> <20131106072444.055753811E0@gemini.denx.de> Message-ID: <5279FE3D.6040909@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 Hi Wolfgang, On 06.11.2013 08:24, Wolfgang Denk wrote: > if (autoconf_version_variable()) > setenv("ver", version_string); /* set version variable */ > > By chance I ran about "include/linux/kconfig.h" in the Linux kernel > tree, which provides (among other things) the IS_ENABLED() macro that > implements essentially the very same feature. Using this, the same > code would be written as: > > if (IS_ENABLED(CONFIG_VERSION_VARIABLE)) > setenv("ver", version_string); /* set version variable */ > > I agree that this does not solve some of the isses that have been > raised about this change (indentation level increses - which may in > turn require reformatting of bigger parts of the code; code becomes > less readable), but on the other hand it avoids the need for a new > autoconf header file, and it should be possible to introduce this > easily step by step. > > And I really like the idea of re-using existing code that is already > known to Linux hackers, especially as we we are currently having our > eyes on the Kconfig stuff anyway. I just recently also noticed this IS_ENABLED() feature (in barebox btw) and thought directly about Simon's patchset regarding this matter. And I personally would favor IS_ENABLED() to the newly created autoconf_xxx names. Thanks, Stefan