From dcb95487fc483822622f9b1072c9401377aff748 Mon Sep 17 00:00:00 2001 From: Gatien Chevallier Date: Thu, 2 Jan 2025 09:44:30 +0100 Subject: [PATCH] [Review] drivers: stm32_rtc: introduce STM32 RTC driver Explicit stm32_rtc_diff_time_ms() expects current is more recent than ref. Signed-off-by: Gatien Chevallier --- core/drivers/stm32_rtc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/drivers/stm32_rtc.c b/core/drivers/stm32_rtc.c index 136d40af9b7..49976d9bbdf 100644 --- a/core/drivers/stm32_rtc.c +++ b/core/drivers/stm32_rtc.c @@ -282,7 +282,11 @@ static void stm32_rtc_fill_time(struct optee_rtc_time *tm) ((dr & RTC_DR_YU_MASK) >> RTC_DR_YU_SHIFT) + 2000; } -/* Return difference in milliseconds on seconds-in-day fraction */ +/* + * Here, we assume that ref is prior to current + * + * Return difference in milliseconds on seconds-in-day fraction + */ static unsigned long long stm32_rtc_diff_time_ms(struct optee_rtc_time *current, struct optee_rtc_time *ref) {