]> git.ipfire.org Git - people/ms/linux.git/commit
iio: imu: adis16400: Fix sign extension
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 22 Jan 2015 23:34:02 +0000 (00:34 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 14 Mar 2015 19:37:20 +0000 (15:37 -0400)
commitc0d65db7de554c63952c20eb412e31af454537e5
tree6f43321dc60b0e7867e235a0b39a83cb4e24d87c
parentec23c856a5102f8a54ff6a376722536c4afb49b1
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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/iio/imu/adis16400_core.c