iio: imu: adis16400: Fix sign extension
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 22 Jan 2015 23:34:02 +0000 (00:34 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:13 +0000 (23:16 +0100)
commit486b2b811cd5ba7f51498cd99105bcd3a3d39f9d
treeaec208ead2ae8f72a89966e000bc18fbfb3a5749
parent931b3f0b3f508b8e020fccdddfb8d98d3c0faa16
iio: imu: adis16400: Fix sign extension

commit 19e353f2b344ad86cea6ebbc0002e5f903480a90 upstream.

The intention is obviously to sign-extend a 12 bit quantity. But
because of C's promotion rules, the assignment is equivalent to "val16
&= 0xfff;". Use the proper API for this.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/staging/iio/imu/adis16400_core.c