File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
drivers/sensor/st/lsm6dsv16x Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -722,15 +722,14 @@ static int lsm6dsv16x_gyro_channel_get(enum sensor_channel chan,
722
722
static void lsm6dsv16x_gyro_channel_get_temp (struct sensor_value * val ,
723
723
struct lsm6dsv16x_data * data )
724
724
{
725
- int32_t micro_c ;
726
-
727
725
/* convert units to micro Celsius. Raw temperature samples are
728
726
* expressed in 256 LSB/deg_C units. And LSB output is 0 at 25 C.
729
727
*/
730
- micro_c = (data -> temp_sample * 1000000 ) / 256 ;
728
+ int64_t temp_sample = data -> temp_sample ;
729
+ int64_t micro_c = (temp_sample * 1000000LL ) / 256 ;
731
730
732
- val -> val1 = micro_c / 1000000 + 25 ;
733
- val -> val2 = micro_c % 1000000 ;
731
+ val -> val1 = ( int32_t )( micro_c / 1000000 ) + 25 ;
732
+ val -> val2 = ( int32_t )( micro_c % 1000000 ) ;
734
733
}
735
734
#endif
736
735
You can’t perform that action at this time.
0 commit comments