]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtc: rv3032: switch to using FIELD_GET_SIGNED()
authorYury Norov <ynorov@nvidia.com>
Mon, 27 Apr 2026 21:41:25 +0000 (17:41 -0400)
committerYury Norov <ynorov@nvidia.com>
Wed, 20 May 2026 15:18:27 +0000 (11:18 -0400)
Switch from sign_extend32(FIELD_GET()) to the dedicated
FIELD_GET_SIGNED() and don't calculate the fields length explicitly.

Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
drivers/rtc/rtc-rv3032.c

index 6c09da7738e1a04c7a1b9341b6bd70d4aafa7cc9..6bafdec637aeadd0c3d9712571947270f757841e 100644 (file)
@@ -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);