diff options
author | Valentin Caron <valentin.caron@foss.st.com> | 2023-07-05 19:43:56 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2023-07-27 23:03:34 +0200 |
commit | 46828a5f89044b8e057f6bbb50ae2bac926a0fa2 (patch) | |
tree | cb4c6df28593e63df98fb226fa3da34df28f2673 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | fb9a7e5360dc8089097337a9685f6fed350a310f (diff) |
rtc: stm32: fix issues of stm32_rtc_valid_alrm function
stm32_rtc_valid_alrm function has 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>
Link: https://lore.kernel.org/r/20230705174357.353616-7-valentin.caron@foss.st.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions