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:
parent
8023d59509
commit
302f06534e
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue