[PATCH] rtc: mcfrtc: fix leap year calculation using wrong variable

Tom Rini trini at konsulko.com
Mon Jun 29 23:34:41 CEST 2026


On Wed, 10 Jun 2026 22:38:40 +0530, Naveen Kumar Chaudhary wrote:

> The leap year check in rtc_set() passes the loop variable 'i' (month
> index, always 1 when the condition is true) to isleap() instead of the
> actual year. Since isleap(1) is always false, February 29th is never
> accounted for when computing the day count, resulting in the RTC being
> set one day behind for any date after February in a leap year.
> 
> Pass tmp->tm_year to isleap() so the leap day is correctly included.
> 
> [...]

Applied to u-boot/next, thanks!

[1/1] rtc: mcfrtc: fix leap year calculation using wrong variable
      commit: 1537ec5ceb7d80edaefb55743bb44e17f303285b
-- 
Tom




More information about the U-Boot mailing list