diff options
author | Csókás, Bence <csokas.bence@prolan.hu> | 2024-06-11 09:24:09 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2024-07-07 00:39:27 +0200 |
commit | 68f78c720da4088d254250867126c6ae5b68fa2a (patch) | |
tree | 5425be29a73dd50445d0e490cd39cad7c01f10f8 /drivers/rtc/interface.c | |
parent | rtc: ds1307: Detect oscillator fail on mcp794xx (diff) | |
download | linux-68f78c720da4088d254250867126c6ae5b68fa2a.tar.xz linux-68f78c720da4088d254250867126c6ae5b68fa2a.zip |
rtc: ds1307: Clamp year to valid BCD (0-99) in `set_time()`
`tm_year` may go up to 299 if the device supports the
century bit. Therefore, subtracting may not give us
a valid 2-digit number, but modulo does.
Co-developed-by: Szentendrei, Tamás <szentendrei.tamas@prolan.hu>
Signed-off-by: Szentendrei, Tamás <szentendrei.tamas@prolan.hu>
Signed-off-by: Csókás, Bence <csokas.bence@prolan.hu>
Link: https://lore.kernel.org/r/20240611072411.671600-2-csokas.bence@prolan.hu
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/interface.c')
0 files changed, 0 insertions, 0 deletions