OSDN Git Service

thermal: tsens: Avoid implicit enum conversions in th_state fields
authorNathan Chancellor <natechancellor@gmail.com>
Fri, 27 Sep 2019 06:39:10 +0000 (23:39 -0700)
committerNathan Chancellor <natechancellor@gmail.com>
Fri, 27 Sep 2019 07:42:38 +0000 (00:42 -0700)
Clang warns:

../drivers/thermal/msm-tsens.c:998:41: warning: implicit conversion from
enumeration type 'enum thermal_trip_activation_mode' to different
enumeration type 'enum thermal_device_mode' [-Wenum-conversion]
                        debug_thr_state_copy.crit_th_state = mode;
                                                           ~ ^~~~
../drivers/thermal/msm-tsens.c:1012:41: warning: implicit conversion
from enumeration type 'enum thermal_trip_activation_mode' to different
enumeration type 'enum thermal_device_mode' [-Wenum-conversion]
                        debug_thr_state_copy.high_th_state = mode;
                                                           ~ ^~~~
../drivers/thermal/msm-tsens.c:1028:40: warning: implicit conversion
from enumeration type 'enum thermal_trip_activation_mode' to different
enumeration type 'enum thermal_device_mode' [-Wenum-conversion]
                        debug_thr_state_copy.low_th_state = mode;
                                                          ~ ^~~~
../drivers/thermal/msm-tsens.c:1074:42: warning: implicit conversion
from enumeration type 'enum thermal_trip_activation_mode' to different
enumeration type 'enum thermal_device_mode' [-Wenum-conversion]
                                debug_thr_state_copy.high_th_state = mode;
                                                                   ~ ^~~~
../drivers/thermal/msm-tsens.c:1085:41: warning: implicit conversion
from enumeration type 'enum thermal_trip_activation_mode' to different
enumeration type 'enum thermal_device_mode' [-Wenum-conversion]
                                debug_thr_state_copy.low_th_state = mode;
                                                                  ~ ^~~~
5 warnings generated.

Fixes: 2021d15137a3 ("thermal: tsens: Enable TSENS")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
drivers/thermal/msm-tsens.c

index db49c33..e558f99 100644 (file)
@@ -199,9 +199,9 @@ enum tsens_tm_trip_type {
 #define TSENS_TM_WRITABLE_TRIPS_MASK ((1 << TSENS_TM_TRIP_NUM) - 1)
 
 struct tsens_thrshld_state {
-       enum thermal_device_mode        high_th_state;
-       enum thermal_device_mode        low_th_state;
-       enum thermal_device_mode        crit_th_state;
+       int                             high_th_state;
+       int                             low_th_state;
+       int                             crit_th_state;
        unsigned int                    high_adc_code;
        unsigned int                    low_adc_code;
        int                             high_temp;