]> git.karo-electronics.de Git - karo-tx-linux.git/commit
olpc_battery: Fix endian neutral breakage for s16 values
authorRichard A. Smith <richard@laptop.org>
Sat, 25 Sep 2010 18:19:26 +0000 (19:19 +0100)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 17 Apr 2011 20:15:39 +0000 (16:15 -0400)
commit0c1eb7f6268985829019b8b12b4022ea2ffaf9cb
treef2b31585e2a3dc836e8ee5f73c7cd9906cd7aa4b
parentc04aca21602d0e28f475e3ad5a87abe52ef1754d
olpc_battery: Fix endian neutral breakage for s16 values

commit 7cfbb29466633e6ecdc14f76a693c8478c2b22af upstream.

When the driver was updated to be endian neutral (8e9c7716c)
the signed part of the s16 values was lost.  This is because be16_to_cpu()
returns an unsigned value.  This patch casts the values back to a s16
number prior to the the implicit cast up to an int.

Signed-off-by: Richard A. Smith <richard@laptop.org>
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/power/olpc_battery.c