Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b45ae32b authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron
Browse files

staging:iio:adis16260: Use sign_extend32() instead of open-coding it

parent f4f87d04
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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: