Skip to content

Commit

Permalink
drivers/sensor: lis2dh: move h/w reg debug print right after it is read
Browse files Browse the repository at this point in the history
Move LOG_DBG print just after the printed h/w register is read, to avoid
coverity complaining about uninitialized variable.

  Fix:
     Coverity-CID: 316407 (issue #58591)

Signed-off-by: Armando Visconti <[email protected]>
  • Loading branch information
avisconti committed Jun 29, 2023
1 parent 2f5068f commit 2614daa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/sensor/lis2dh/lis2dh_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ static void lis2dh_thread_cb(const struct device *dev)
LOG_ERR("clearing interrupt 2 failed: %d", status);
return;
}

LOG_DBG("@tick=%u int2_src=0x%x", k_cycle_get_32(), reg_val);
}

if (likely(lis2dh->handler_anymotion != NULL)) {
Expand All @@ -400,9 +402,6 @@ static void lis2dh_thread_cb(const struct device *dev)
setup_int2(dev, true);
}

LOG_DBG("@tick=%u int2_src=0x%x", k_cycle_get_32(),
reg_val);

return;
}
}
Expand Down

0 comments on commit 2614daa

Please sign in to comment.