From 65bbca4a07f87504d6446e268b4d63bf8ee9bf40 Mon Sep 17 00:00:00 2001 From: Nick Ward Date: Thu, 25 May 2023 17:43:37 +1000 Subject: [PATCH] drivers: sensor: vl53l0x: small fixes Remove redundant casts. Signed-off-by: Nick Ward --- drivers/sensor/vl53l0x/vl53l0x.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/sensor/vl53l0x/vl53l0x.c b/drivers/sensor/vl53l0x/vl53l0x.c index c3a7ef41b4f..33143656443 100644 --- a/drivers/sensor/vl53l0x/vl53l0x.c +++ b/drivers/sensor/vl53l0x/vl53l0x.c @@ -81,7 +81,7 @@ static int vl53l0x_setup_single_shot(const struct device *dev) } ret = VL53L0X_PerformRefSpadManagement(&drv_data->vl53l0x, - (uint32_t *)&refSpadCount, + &refSpadCount, &isApertureSpads); if (ret) { LOG_ERR("[%s] VL53L0X_PerformRefSpadManagement failed", @@ -171,7 +171,7 @@ static int vl53l0x_start(const struct device *dev) int r; VL53L0X_Error ret; uint16_t vl53l0x_id = 0U; - VL53L0X_DeviceInfo_t vl53l0x_dev_info; + VL53L0X_DeviceInfo_t vl53l0x_dev_info = { 0 }; LOG_DBG("[%s] Starting", dev->name); @@ -200,9 +200,6 @@ static int vl53l0x_start(const struct device *dev) } #endif - /* Get info from sensor */ - (void)memset(&vl53l0x_dev_info, 0, sizeof(VL53L0X_DeviceInfo_t)); - ret = VL53L0X_GetDeviceInfo(&drv_data->vl53l0x, &vl53l0x_dev_info); if (ret < 0) { LOG_ERR("[%s] Could not get info from device.", dev->name); @@ -220,7 +217,7 @@ static int vl53l0x_start(const struct device *dev) ret = VL53L0X_RdWord(&drv_data->vl53l0x, VL53L0X_REG_WHO_AM_I, - (uint16_t *) &vl53l0x_id); + &vl53l0x_id); if ((ret < 0) || (vl53l0x_id != VL53L0X_CHIP_ID)) { LOG_ERR("[%s] Issue on device identification", dev->name); return -ENOTSUP;