From: Yury Norov Date: Mon, 27 Apr 2026 21:41:25 +0000 (-0400) Subject: rtc: rv3032: switch to using FIELD_GET_SIGNED() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0e5d07ac5516afd99f9930db9a085619b7895b9;p=thirdparty%2Fkernel%2Flinux.git rtc: rv3032: 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: Alexandre Belloni Signed-off-by: Yury Norov --- diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c index 6c09da7738e1a..6bafdec637aea 100644 --- a/drivers/rtc/rtc-rv3032.c +++ b/drivers/rtc/rtc-rv3032.c @@ -376,7 +376,7 @@ static int rv3032_read_offset(struct device *dev, long *offset) if (ret < 0) return ret; - steps = sign_extend32(FIELD_GET(RV3032_OFFSET_MSK, value), 5); + steps = FIELD_GET_SIGNED(RV3032_OFFSET_MSK, value); *offset = DIV_ROUND_CLOSEST(steps * OFFSET_STEP_PPT, 1000);