forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rtc: stm32: fix issues of stm32_rtc_valid_alrm function
stm32_rtc_valid_alrm function have some issues : - arithmetical operations are impossible on BCD values - "cur_mon + 1" can overflow - the use case with the next month, the same day/hour/minutes went wrong To solve that, we prefer to use timestamp comparison. e.g. : On 5 Dec. 2021, the alarm limit is 5 Jan. 2022 (+31 days) On 31 Jan 2021, the alarm limit is 28 Feb. 2022 (+28 days) Signed-off-by: Valentin Caron <[email protected]> Change-Id: I8b694f8e54c0ea7eda6c5080be1b00cad4f20cb5 Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/240381 Reviewed-by: CITOOLS <[email protected]> Reviewed-by: CIBUILD <[email protected]> Reviewed-by: Fabien DESSENNE <[email protected]>
- Loading branch information
Showing
1 changed file
with
33 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters