Merge tag 'v4.4.12' into linux-linaro-lsk-v4.4
[firefly-linux-kernel-4.4.55.git] / include / linux / kconfig.h
index 63ca8dacec59c7165b612200f4c4573fc039cc2a..b33c7797eb5707122e9acc4167f15317d0069c39 100644 (file)
  */
 #define IS_MODULE(option) config_enabled(option##_MODULE)
 
+/*
+ * 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)))
+
 /*
  * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
  * 0 otherwise.