diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2015-04-25 17:22:39 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2015-04-26 22:48:05 +0200 |
commit | 5fb2048b36457613c1fe21e620c41313d1c7b7c3 (patch) | |
tree | e5dc3aed1726faf2d20e35f67e9a5d469192bfdf /backport/backport-include/linux/kconfig.h | |
parent | 8f5a4122c86a8fbd78098ec2c83ed5342281610a (diff) |
header: add IS_REACHABLE()
This was introduced in commit 9b174527e and is used by the media
drivers.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'backport/backport-include/linux/kconfig.h')
-rw-r--r-- | backport/backport-include/linux/kconfig.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/backport/backport-include/linux/kconfig.h b/backport/backport-include/linux/kconfig.h index ee938e30..4fe2a108 100644 --- a/backport/backport-include/linux/kconfig.h +++ b/backport/backport-include/linux/kconfig.h @@ -24,4 +24,15 @@ #undef IS_BUILTIN #define IS_BUILTIN(option) config_enabled(option) +#ifndef IS_REACHABLE +/* + * IS_REACHABLE(CONFIG_FOO) evaluates to 1 if the currently compiled + * code can call a function defined in code compiled based on CONFIG_FOO. + * This is similar to IS_ENABLED(), but returns false when invoked from + * built-in code when CONFIG_FOO is set to 'm'. + */ +#define IS_REACHABLE(option) (config_enabled(option) || \ + (config_enabled(option##_MODULE) && config_enabled(MODULE))) +#endif + #endif |