From cbe8c35f9e43444f4d1b01ec576af3563b1f1546 Mon Sep 17 00:00:00 2001 From: Nick Ward Date: Sat, 10 Jun 2023 19:00:58 +1000 Subject: [PATCH] drivers: sensor: update function parameters to const These parameters are not modified by the functions. Signed-off-by: Nick Ward --- include/zephyr/drivers/sensor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zephyr/drivers/sensor.h b/include/zephyr/drivers/sensor.h index add8b51306d1c8..9a74a536949963 100644 --- a/include/zephyr/drivers/sensor.h +++ b/include/zephyr/drivers/sensor.h @@ -1211,7 +1211,7 @@ struct sensor_info { * @param val A pointer to a sensor_value struct. * @return The converted value. */ -static inline int64_t sensor_value_to_milli(struct sensor_value *val) +static inline int64_t sensor_value_to_milli(const struct sensor_value *val) { return ((int64_t)val->val1 * 1000) + val->val2 / 1000; } @@ -1222,7 +1222,7 @@ static inline int64_t sensor_value_to_milli(struct sensor_value *val) * @param val A pointer to a sensor_value struct. * @return The converted value. */ -static inline int64_t sensor_value_to_micro(struct sensor_value *val) +static inline int64_t sensor_value_to_micro(const struct sensor_value *val) { return ((int64_t)val->val1 * 1000000) + val->val2; }