]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rtc: m48t59: Remove division condition with direct comparison
authorAbhishek Tamboli <abhishektamboli9@gmail.com>
Fri, 9 Aug 2024 15:56:31 +0000 (21:26 +0530)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 11 Sep 2024 22:36:53 +0000 (00:36 +0200)
commit60a06efc56d7d336d13fae58f9e90c8a4e21619e
tree2e304e5fecf56ed8c2df953f078ad2aa37d292f4
parent73580e2ee6adfb40276bd420da3bb1abae204e10
rtc: m48t59: Remove division condition with direct comparison

Replace 'year / 100' with a direct comparison 'year >= 100'
in m48t59_rtc_set_time() function. Improve the code clarity
and eliminate division overhead.

Fix the following smatch warning:
drivers/rtc/rtc-m48t59.c:135 m48t59_rtc_set_time() warn:
replace divide condition 'year / 100' with 'year >= 100'

Signed-off-by: Abhishek Tamboli <abhishektamboli9@gmail.com>
Link: https://lore.kernel.org/r/20240809155631.548044-1-abhishektamboli9@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-m48t59.c