From: Yury Norov Date: Mon, 27 Apr 2026 21:41:23 +0000 (-0400) Subject: iio: mcp9600: switch to using FIELD_GET_SIGNED() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1af735749f5d6470742192ec06f57f9e28aee614;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Yury Norov --- diff --git a/drivers/iio/temperature/mcp9600.c b/drivers/iio/temperature/mcp9600.c index aa42c2b1a369e..69baf654c9c0a 100644 --- a/drivers/iio/temperature/mcp9600.c +++ b/drivers/iio/temperature/mcp9600.c @@ -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: