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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:26:37 +0000 (13:26 -0800)
commitf67e4460bc1d537fc560260a37497e11dac8bbe6
treee1eba800aaa85d43597c5d56f82457096428bb22
parentede95dde4625bd00afdaaa479a2d5cfee1a49555
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: Greg Kroah-Hartman <gregkh@suse.de>
drivers/power/olpc_battery.c