Re: [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h

From: Michal Marek
Date: Thu Apr 12 2012 - 05:27:05 EST


On 12.4.2012 03:19, Linus Torvalds wrote:
> On Wed, Apr 11, 2012 at 4:58 PM, Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> I think we can easily drop IS_ENABLED() if it has been causing
>> problems. And it clearly is.

What is really causing problems is that kconfig has no view of the
entire kernel configuration.


>> And I had never even looked at that generated file. It's disgusting.
>> We need to stop doing that. It must be driving compile-times up too -
>> just parsing that monster is RealWork(tm).

You forgot that it also contributes to global warming.


> Oh, but I have a sick and twisted mind. And I'm incredibly smart and
> photogenic too.
>
> Here's an implementation of IS_ENABLED() that works in C. Well,
> "gcc-C". It depends on the optimizer DTRT, but gcc really does seem to
> do it.
>
> Ready? You *will* go blind - blinded by the pure beauty and intellect
> in this thing:
>
> #define IS_DEFINED(x) (__stringify(CONFIG_##x)[0]=='1')

Nice. Maybe we could make it simply

#define IS_DEFINED(x) (__stringify(x)[0]=='1')

so that the users are easily grepable and it is obvious that a config
option is being tested, like in the current implementation. The only
thing we lose is the check if 'x' is really a boolean or tristate
option. But it turns out that even now this does not work in all cases.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/