Skip to content

Commit

Permalink
drivers: sensor: update function parameters to const
Browse files Browse the repository at this point in the history
These parameters are not modified by the functions.

Signed-off-by: Nick Ward <[email protected]>
  • Loading branch information
nixward authored and nashif committed Jun 17, 2023
1 parent bb87a87 commit cbe8c35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/zephyr/drivers/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit cbe8c35

Please sign in to comment.