projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4f87d0
)
staging:iio:adis16260: Use sign_extend32() instead of open-coding it
author
Lars-Peter Clausen
<lars@metafoo.de>
Wed, 17 Jul 2013 14:44:00 +0000
(15:44 +0100)
committer
Jonathan Cameron
<jic23@kernel.org>
Sat, 3 Aug 2013 17:41:20 +0000
(18:41 +0100)
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/gyro/adis16260_core.c
patch
|
blob
|
history
diff --git
a/drivers/staging/iio/gyro/adis16260_core.c
b/drivers/staging/iio/gyro/adis16260_core.c
index 55e67959b054346fc3c23b13afa3a67477f47b54..f060452f367e698493852e24df908fc1c31f7632 100644
(file)
--- a/
drivers/staging/iio/gyro/adis16260_core.c
+++ b/
drivers/staging/iio/gyro/adis16260_core.c
@@
-277,9
+277,7
@@
static int adis16260_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&indio_dev->mlock);
return ret;
}
- val16 &= (1 << bits) - 1;
- val16 = (s16)(val16 << (16 - bits)) >> (16 - bits);
- *val = val16;
+ *val = sign_extend32(val16, bits - 1);
mutex_unlock(&indio_dev->mlock);
return IIO_VAL_INT;
case IIO_CHAN_INFO_CALIBSCALE: