You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <valentin.caron@foss.st.com>
Change-Id: I8b694f8e54c0ea7eda6c5080be1b00cad4f20cb5
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/239160
Reviewed-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Eric FOURMONT <eric.fourmont-ext@st.com>
Tested-by: Eric FOURMONT <eric.fourmont-ext@st.com>
0 commit comments