mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
iio: mcp9600: switch to using FIELD_GET_SIGNED()
Switch from sign_extend32(FIELD_GET()) to the dedicated FIELD_GET_SIGNED() and don't calculate the fields length explicitly. Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Yury Norov <ynorov@nvidia.com>
This commit is contained in:
parent
d0f331af3b
commit
1af735749f
|
|
@ -297,7 +297,7 @@ static int mcp9600_read_thresh(struct iio_dev *indio_dev,
|
|||
* Temperature is stored in two’s complement format in
|
||||
* bits(15:2), LSB is 0.25 degree celsius.
|
||||
*/
|
||||
*val = sign_extend32(FIELD_GET(MCP9600_ALERT_LIMIT_MASK, ret), 13);
|
||||
*val = FIELD_GET_SIGNED(MCP9600_ALERT_LIMIT_MASK, ret);
|
||||
*val2 = 4;
|
||||
return IIO_VAL_FRACTIONAL;
|
||||
case IIO_EV_INFO_HYSTERESIS:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user