summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/interface.c
diff options
context:
space:
mode:
authorCsókás, Bence <csokas.bence@prolan.hu>2024-06-11 09:24:09 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2024-07-07 00:39:27 +0200
commit68f78c720da4088d254250867126c6ae5b68fa2a (patch)
tree5425be29a73dd50445d0e490cd39cad7c01f10f8 /drivers/rtc/interface.c
parentrtc: ds1307: Detect oscillator fail on mcp794xx (diff)
downloadlinux-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