• Daniel Lezcano's avatar
    hwmon/drivers/core: Simplify complex dependency · f3735332
    Daniel Lezcano authored
    As the thermal framework does not longer compile as a module, we can
    simplify this condition below:
    
     if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \
           (!defined(CONFIG_THERMAL_HWMON) || \
            !(defined(MODULE) && IS_MODULE(CONFIG_THERMAL)))
    
     if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \
           (!defined(CONFIG_THERMAL_HWMON) || \
            !(defined(MODULE) && 0))
    
    => (whatever && 0) = 0
    
     if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \
           (!defined(CONFIG_THERMAL_HWMON) || !(0))
    
     if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \
           (!defined(CONFIG_THERMAL_HWMON) || 1)
    
    => (whatever || 1) = 1
    
     if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \
           (1)
    
    => (whatever && 1) = whatever
    
     if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF)
    
    CONFIG_THERMAL can not be a module anymore, then:
    
     if defined(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF)
    
    And CONFIG_THERMAL_OF already depends on CONFIG_THERMAL, so:
    
     if defined(CONFIG_THERMAL_OF)
    
    Thus,
    
     ifdef CONFIG_THERMAL_OF
    Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
    Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    f3735332
hwmon.c 24 KB