lkml.org 
[lkml]   [2011]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kconfig: Introduce IS_ENABLED(), IS_BUILTIN() and IS_MODULE()
On Fri, 29 Jul 2011 15:51:37 +0200 Michal Marek wrote:

> Replace the config_is_*() macros with a variant that allows for grepping
> for usage of CONFIG_* options in the code. Usage:
>
> if (IS_ENABLED(CONFIG_NUMA))
>
> or
>
> #if IS_ENABLED(CONFIG_NUMA)
>
> The IS_ENABLED() macro evaluates to 1 if the argument is set (to either 'y'
> or 'm'), IS_BUILTIN() tests if the option is 'y' and IS_MODULE() test if
> the option is 'm'. Only boolean and tristate options are supported.
>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
>
> Everybody happy with the above naming?

Yes here.

Acked-by: Randy Dunlap <rdunlap@xenotime.net>

These strings are being written to the .config file, right?

> + /*
> + * Generate the __enabled_CONFIG_* and
> + * __enabled_CONFIG_*_MODULE macros for use by the
> + * IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
> + * generated even for booleans so that the IS_ENABLED() macro
> + * works.
> + */
> + fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
> + sym->name, (*value == 'y'));
> + fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
> + sym->name, (*value == 'm'));
> break;


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***


\
 
 \ /
  Last update: 2011-07-29 20:27    [W:0.090 / U:3.916 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site