lkml.org 
[lkml]   [2012]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h
Hi Linus,

On Wed, 11 Apr 2012 18:55:10 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> On Wed, Apr 11, 2012 at 6:45 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > So we shouldn't call it IS_DEFINED() - that would cause confusion with
> > the old version.
>
> Yeah. Maybe we should call it "config_enabled()" - the lower-case
> hopefully makes it clear that it acts as a C function, not a
> preprocessor one.
>
> Code like "if (config_enabled(IPV6))" looks reasonably readable to me.
>
> I asked G+ if they can come up with a better trick. They did well on
> the whole bitmask calculations, maybe somebody can figure out how to
> make the same macro work for both preprocessor and C code...

Can we leave the CONFIG_ part in the caller, so they are still grepable, please?

So:

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

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-04-12 05:13    [W:0.068 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site