Skip to content

Commit 1e75b82

Browse files
committed
sensors: lsm6dsv16x: fix double-promotion warning
use roundf instead of round in Q31_SHIFT_VAL macro to avoid double-promotion warning Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 273d601 commit 1e75b82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/sensor/st/lsm6dsv16x/lsm6dsv16x_decoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static const uint32_t sflp_period_ns[] = {
6666
* Expand val to q31_t according to its range; this is achieved multiplying by 2^31/2^range.
6767
*/
6868
#define Q31_SHIFT_VAL(val, range) \
69-
(q31_t) (round((val) * ((int64_t)1 << (31 - (range)))))
69+
(q31_t) (roundf((val) * ((int64_t)1 << (31 - (range)))))
7070

7171
/*
7272
* Expand micro_val (a generic micro unit) to q31_t according to its range; this is achieved

0 commit comments

Comments
 (0)