summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury Norov <ynorov@nvidia.com>2026-04-28 00:41:22 +0300
committerYury Norov <ynorov@nvidia.com>2026-05-20 18:18:27 +0300
commitd0f331af3b363ec165b13d28623f4bc66a30eaf4 (patch)
treebc5a40bbc7542133c58500ce99c96595a6203c0e
parent465af055db5b3804b4881e9cd07eeaea6dc3e460 (diff)
downloadlinux-d0f331af3b363ec165b13d28623f4bc66a30eaf4.tar.xz
iio: pressure: bmp280: 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>
-rw-r--r--drivers/iio/pressure/bmp280-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index d983ce9c0b99..f722aea16e0e 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -392,7 +392,7 @@ static int bme280_read_calib(struct bmp280_data *data)
h4_lower = FIELD_GET(BME280_COMP_H4_MASK_LOW, tmp_1);
calib->H4 = sign_extend32(h4_upper | h4_lower, 11);
tmp_3 = get_unaligned_le16(&data->bme280_humid_cal_buf[H5]);
- calib->H5 = sign_extend32(FIELD_GET(BME280_COMP_H5_MASK, tmp_3), 11);
+ calib->H5 = FIELD_GET_SIGNED(BME280_COMP_H5_MASK, tmp_3);
calib->H6 = data->bme280_humid_cal_buf[H6];
return 0;