Skip to content

Commit 609961c

Browse files
committed
icm45686: fix unhandled shift being zero
Even though it's not listed in the options of icm45686_get_shift(), for completeness sake, do not leave an unhandled range. Signed-off-by: Luis Ubieda <[email protected]>
1 parent dff24c8 commit 609961c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/sensor/tdk/icm45686/icm45686_decoder.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ int icm45686_convert_raw_to_q31(struct icm45686_encoded_data *edata,
125125
if (shift < 0) {
126126
intermediate =
127127
intermediate * ((int64_t)INT32_MAX + 1) * (1 << -shift) / INT64_C(1000000);
128-
} else if (shift > 0) {
128+
} else {
129129
intermediate =
130130
intermediate * ((int64_t)INT32_MAX + 1) / ((1 << shift) * INT64_C(1000000));
131131
}
@@ -404,7 +404,7 @@ static q31_t icm45686_fifo_read_temp_from_packet(const uint8_t *pkt)
404404
if (shift < 0) {
405405
intermediate =
406406
intermediate * ((int64_t)INT32_MAX + 1) * (1 << -shift) / INT64_C(1000000);
407-
} else if (shift > 0) {
407+
} else {
408408
intermediate =
409409
intermediate * ((int64_t)INT32_MAX + 1) / ((1 << shift) * INT64_C(1000000));
410410
}
@@ -450,7 +450,7 @@ static int icm45686_fifo_read_imu_from_packet(const uint8_t *pkt,
450450
if (shift < 0) {
451451
intermediate =
452452
intermediate * ((int64_t)INT32_MAX + 1) * (1 << -shift) / INT64_C(1000000);
453-
} else if (shift > 0) {
453+
} else {
454454
intermediate =
455455
intermediate * ((int64_t)INT32_MAX + 1) / ((1 << shift) * INT64_C(1000000));
456456
}

0 commit comments

Comments
 (0)