Skip to content

Commit

Permalink
drivers: sensor: st: Fix uninitialized variable in lsm6dsv16x
Browse files Browse the repository at this point in the history
Fix uninitialized ret variables scanned by Coverity.

Signed-off-by: James Roy <[email protected]>
  • Loading branch information
rruuaanng committed Nov 27, 2024
1 parent b8360ad commit 59ef010
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/sensor/st/lsm6dsv16x/lsm6dsv16x_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static int lsm6dsv16x_enable_xl_int(const struct device *dev, int enable)
{
const struct lsm6dsv16x_config *cfg = dev->config;
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
int ret;
int ret = 0;

if (enable) {
int16_t buf[3];
Expand Down Expand Up @@ -72,7 +72,7 @@ static int lsm6dsv16x_enable_g_int(const struct device *dev, int enable)
{
const struct lsm6dsv16x_config *cfg = dev->config;
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
int ret;
int ret = 0;

if (enable) {
int16_t buf[3];
Expand Down Expand Up @@ -229,7 +229,7 @@ int lsm6dsv16x_init_interrupt(const struct device *dev)
struct lsm6dsv16x_data *lsm6dsv16x = dev->data;
const struct lsm6dsv16x_config *cfg = dev->config;
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
int ret;
int ret = 0;

lsm6dsv16x->drdy_gpio = (cfg->drdy_pin == 1) ?
(struct gpio_dt_spec *)&cfg->int1_gpio :
Expand Down

0 comments on commit 59ef010

Please sign in to comment.