Re: [PATCH 1/2] linux/kconfig.h: generalize IS_ENABLED logic

2015-10-08 Thread Michal Marek
On 2015-10-07 23:33, Rasmus Villemoes wrote: > On Wed, Oct 07 2015, Michal Marek wrote: >> It should be accompanied by a patch to scripts/tags.sh teaching >> ctags/etags about the new macros. > > Do you mean that something like > > --regex-c='/COND_CONFIG\([^,]*,([^,]*)\)/\1/' > > should

Re: [PATCH 1/2] linux/kconfig.h: generalize IS_ENABLED logic

2015-10-08 Thread Michal Marek
On 2015-10-07 23:33, Rasmus Villemoes wrote: > On Wed, Oct 07 2015, Michal Marek wrote: >> It should be accompanied by a patch to scripts/tags.sh teaching >> ctags/etags about the new macros. > > Do you mean that something like > >

Re: [PATCH 1/2] linux/kconfig.h: generalize IS_ENABLED logic

2015-10-07 Thread Rasmus Villemoes
On Wed, Oct 07 2015, Michal Marek wrote: > On 2015-10-06 23:05, Rasmus Villemoes wrote: >> It's not hard to generalize the macro magic used to build the >> IS_ENABLED macro and friends to produce a few other potentially useful >> macros: >> >> CHOOSE_EXPR(CONFIG_FOO, expr): if CONFIG_FOO is set

Re: [PATCH 1/2] linux/kconfig.h: generalize IS_ENABLED logic

2015-10-07 Thread Michal Marek
On 2015-10-06 23:05, Rasmus Villemoes wrote: > It's not hard to generalize the macro magic used to build the > IS_ENABLED macro and friends to produce a few other potentially useful > macros: > > CHOOSE_EXPR(CONFIG_FOO, expr): if CONFIG_FOO is set expands to > expr, otherwise expands to nothing.

Re: [PATCH 1/2] linux/kconfig.h: generalize IS_ENABLED logic

2015-10-07 Thread Ingo Molnar
* Rasmus Villemoes wrote: > +#define _COMMA , > +#define _COND_PUNCTUATION_0(p) > +#define _COND_PUNCTUATION_1(p) p > + > +#define CHOOSE_EXPR(cfg, expr, ...) _CHOOSE_EXPR(cfg, expr, ##__VA_ARGS__, > /* empty defalt arg */) > +#define _CHOOSE_EXPR(cfg, expr, def, ...) >

Re: [PATCH 1/2] linux/kconfig.h: generalize IS_ENABLED logic

2015-10-07 Thread Rasmus Villemoes
On Wed, Oct 07 2015, Michal Marek wrote: > On 2015-10-06 23:05, Rasmus Villemoes wrote: >> It's not hard to generalize the macro magic used to build the >> IS_ENABLED macro and friends to produce a few other potentially useful >> macros: >> >> CHOOSE_EXPR(CONFIG_FOO, expr): if

Re: [PATCH 1/2] linux/kconfig.h: generalize IS_ENABLED logic

2015-10-07 Thread Michal Marek
On 2015-10-06 23:05, Rasmus Villemoes wrote: > It's not hard to generalize the macro magic used to build the > IS_ENABLED macro and friends to produce a few other potentially useful > macros: > > CHOOSE_EXPR(CONFIG_FOO, expr): if CONFIG_FOO is set expands to > expr, otherwise expands to nothing.

Re: [PATCH 1/2] linux/kconfig.h: generalize IS_ENABLED logic

2015-10-07 Thread Ingo Molnar
* Rasmus Villemoes wrote: > +#define _COMMA , > +#define _COND_PUNCTUATION_0(p) > +#define _COND_PUNCTUATION_1(p) p > + > +#define CHOOSE_EXPR(cfg, expr, ...) _CHOOSE_EXPR(cfg, expr, ##__VA_ARGS__, > /* empty defalt arg */) > +#define _CHOOSE_EXPR(cfg, expr, def, ...)