fuel_gauge: sbs_gauge: fix uninitialized variable warning

The return variable rc in sbs_gauge_do_battery_cutoff() needs to
be initialized, or else it would return random value if the for
loop is never entered.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2023-08-22 15:06:25 -07:00 committed by Anas Nashif
commit 302f06534e

View file

@ -179,7 +179,7 @@ static int sbs_gauge_get_prop(const struct device *dev, struct fuel_gauge_get_pr
static int sbs_gauge_do_battery_cutoff(const struct device *dev)
{
int rc;
int rc = -ENOTSUP;
const struct sbs_gauge_config *cfg = dev->config;
if (cfg->cutoff_cfg == NULL) {