summaryrefslogtreecommitdiff
path: root/include/linux/if_eql.h
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-06-14 14:58:57 +0900
committerMichal Marek <mmarek@suse.com>2016-06-20 22:42:32 +0200
commit5e8754fd80b0a594f720f44d32bf28c7b06ba5a6 (patch)
treee1999ea36950a515194cb3874e54f7e657828d92 /include/linux/if_eql.h
parent05a25c8e2c593914c18faf91dfb5ee471b79ce58 (diff)
kconfig.h: allow to use IS_{ENABLE,REACHABLE} in macro expansion
The typical usage of IS_ENABLED() is if (IS_ENABLED(CONFIG_FOO)) { ... } or #if IS_ENABLED(CONFIG_FOO) ... #endif The current implementation of IS_ENABLED() includes "||" operator, which works well in those expressions like above. However, there is a case where we want to evaluate a config option beyond those use cases. For example, the OF_TABLE() in include/asm-generic/vmlinux.lds.h needs to evaluate a config option in macro expansion: #define ___OF_TABLE(cfg, name) _OF_TABLE_##cfg(name) #define __OF_TABLE(cfg, name) ___OF_TABLE(cfg, name) #define OF_TABLE(cfg, name) __OF_TABLE(config_enabled(cfg), name) #define _OF_TABLE_0(name) #define _OF_TABLE_1(name) \ ... Here, we can not use IS_ENABLED() because of the "||" operator in its define. It is true config_enabled() works well, but it is a bit ambiguous to be used against config options. This commit makes IS_ENABLED() available in more generic context by calculating "or" with macro expansion only. Do likewise for IS_REACHABLE(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'include/linux/if_eql.h')
0 files changed, 0 insertions, 0 deletions