[lkml]   [2012]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 5/5] kconfig: limit IS_ENABLED & similar to CPP usage
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.


> 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

 \ /
  Last update: 2012-04-12 19:49    [W:0.034 / U:4.812 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site