Skip to content
Commit 68f78c72 authored by Csókás, Bence's avatar Csókás, Bence Committed by Alexandre Belloni
Browse files

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: default avatarSzentendrei, Tamás <szentendrei.tamas@prolan.hu>
Signed-off-by: default avatarSzentendrei, Tamás <szentendrei.tamas@prolan.hu>
Signed-off-by: default avatarCsókás, Bence <csokas.bence@prolan.hu>
Link: https://lore.kernel.org/r/20240611072411.671600-2-csokas.bence@prolan.hu


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 35a34f09
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment