Skip to content

Commit

Permalink
charger-manager: Simplify charger_get_property(), get rid of a warning
Browse files Browse the repository at this point in the history
This patch fixes the following warning and makes the code a little
bit more simpler:

  CC      drivers/power/charger-manager.o
charger-manager.c: In function 'charger_get_property':
charger-manager.c:429:15: warning: 'i' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
  • Loading branch information
Anton Vorontsov committed Mar 26, 2012
1 parent bb2a95c commit df58c04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/power/charger-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ static int charger_get_property(struct power_supply *psy,
struct charger_manager *cm = container_of(psy,
struct charger_manager, charger_psy);
struct charger_desc *desc = cm->desc;
int i, ret = 0, uV;
int ret = 0;
int uV;

switch (psp) {
case POWER_SUPPLY_PROP_STATUS:
Expand All @@ -425,8 +426,7 @@ static int charger_get_property(struct power_supply *psy,
val->intval = 0;
break;
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
ret = get_batt_uV(cm, &i);
val->intval = i;
ret = get_batt_uV(cm, &val->intval);
break;
case POWER_SUPPLY_PROP_CURRENT_NOW:
ret = cm->fuel_gauge->get_property(cm->fuel_gauge,
Expand Down

0 comments on commit df58c04

Please sign in to comment.