]> 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)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:05 +0000 (23:40 +0100)
commit992c78f9f294b8dfc72c783fce9b83151407cf74
tree27d4f914133f5318677a5f484a0d4fa858784bfb
parentf38e82fdf2a2e201f188b9d48b145284ab38f74c
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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/power/olpc_battery.c