mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
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 <alexandre.belloni@bootlin.com> Signed-off-by: Yury Norov <ynorov@nvidia.com>
This commit is contained in:
parent
115e1f213c
commit
f0e5d07ac5
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user