From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com ([147.11.146.13]:47398 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757847Ab2DLRrF (ORCPT ); Thu, 12 Apr 2012 13:47:05 -0400 Message-ID: <4F8714F5.1050605@windriver.com> Date: Thu, 12 Apr 2012 13:46:29 -0400 From: Paul Gortmaker MIME-Version: 1.0 Subject: Re: [PATCH 5/5] kconfig: limit IS_ENABLED & similar to CPP usage References: <1334188257-3449-1-git-send-email-paul.gortmaker@windriver.com> <1334188257-3449-6-git-send-email-paul.gortmaker@windriver.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Linus Torvalds Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, davem@davemloft.net, tony@bakeyournoodle.com, mmarek@suse.cz, lacombar@gmail.com On 12-04-11 08:04 PM, Linus Torvalds wrote: > On Wed, Apr 11, 2012 at 4:50 PM, Paul Gortmaker > wrote: >> Using IS_ENABLED() within C (vs. within CPP #if statements) requires >> us to actually define every possible bool/tristate Kconfig option >> twice (__enabled_* and __enabled_*_MODULE variants). > > Why do you keep the __enabled_*[_MODULE] things alive at all? Good point. Clearly I wasn't aggressive enough in my shitectomy. Testing with no __enabled_* stuff now. That reduces the line count even more, which is nice. I've not auto-prefixed the CONFIG_ though, since that seems to break the grep use case. P. > > Why can't you just check the CONFIG_xyz[_MODULE] #defines directly? > > IOW, why isn't IS_ENABLED() just > > #define IS_ENABLED(option) \ > (defined(CONFIG_##option) || defined(CONFIG_##option##_MODULE)) > > #define IS_BUILTIN(option) \ > (defined(CONFIG_##option)) > > and we're done with it all? What's the advantage of the __enabled_ > thing again, when you depend on the preprocessor anyway? > > Linus