Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217399
b: refs/heads/master
c: 7cfbb29
h: refs/heads/master
i:
  217397: adecc76
  217395: 52d1ce7
  217391: 4dcefac
v: v3
  • Loading branch information
Richard A. Smith authored and Anton Vorontsov committed Sep 28, 2010
1 parent 0fe06dd commit a2802ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6127b8645207b4cb43e7456214c6add7c37cdc1
refs/heads/master: 7cfbb29466633e6ecdc14f76a693c8478c2b22af
8 changes: 4 additions & 4 deletions trunk/drivers/power/olpc_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,14 @@ static int olpc_bat_get_property(struct power_supply *psy,
if (ret)
return ret;

val->intval = (int)be16_to_cpu(ec_word) * 9760L / 32;
val->intval = (s16)be16_to_cpu(ec_word) * 9760L / 32;
break;
case POWER_SUPPLY_PROP_CURRENT_AVG:
ret = olpc_ec_cmd(EC_BAT_CURRENT, NULL, 0, (void *)&ec_word, 2);
if (ret)
return ret;

val->intval = (int)be16_to_cpu(ec_word) * 15625L / 120;
val->intval = (s16)be16_to_cpu(ec_word) * 15625L / 120;
break;
case POWER_SUPPLY_PROP_CAPACITY:
ret = olpc_ec_cmd(EC_BAT_SOC, NULL, 0, &ec_byte, 1);
Expand All @@ -299,7 +299,7 @@ static int olpc_bat_get_property(struct power_supply *psy,
if (ret)
return ret;

val->intval = (int)be16_to_cpu(ec_word) * 100 / 256;
val->intval = (s16)be16_to_cpu(ec_word) * 100 / 256;
break;
case POWER_SUPPLY_PROP_TEMP_AMBIENT:
ret = olpc_ec_cmd(EC_AMB_TEMP, NULL, 0, (void *)&ec_word, 2);
Expand All @@ -313,7 +313,7 @@ static int olpc_bat_get_property(struct power_supply *psy,
if (ret)
return ret;

val->intval = (int)be16_to_cpu(ec_word) * 6250 / 15;
val->intval = (s16)be16_to_cpu(ec_word) * 6250 / 15;
break;
case POWER_SUPPLY_PROP_SERIAL_NUMBER:
ret = olpc_ec_cmd(EC_BAT_SERIAL, NULL, 0, (void *)&ser_buf, 8);
Expand Down

0 comments on commit a2802ce

Please sign in to comment.