drivers: fix double promotion warnings

With -Wdouble-promotion added to the warning base, fix warnings given
by the compiler.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
This commit is contained in:
Ryan McClelland 2021-10-03 13:53:14 -07:00 committed by Christopher Friedt
commit b7bedb5c1e
9 changed files with 45 additions and 45 deletions

View file

@ -161,7 +161,7 @@ static inline void lsm9ds0_gyro_convert(struct sensor_value *val, int raw_val,
{
double dval;
dval = (double)(raw_val) * numerator / 1000.0 * DEG2RAD;
dval = (double)(raw_val) * (double)numerator / 1000.0 * DEG2RAD;
val->val1 = (int32_t)dval;
val->val2 = ((int32_t)(dval * 1000000)) % 1000000;
}