lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241006001553.7430-1-iwamatsu@nigauri.org>
Date: Sun,  6 Oct 2024 09:15:53 +0900
From: Nobuhiro Iwamatsu <iwamatsu@...auri.org>
To: alexandre.belloni@...tlin.com,
	linux-rtc@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Nobuhiro Iwamatsu <iwamatsu@...auri.org>
Subject: [PATCH] rtc: rtc-mc146818-lib: Use is_leap_year instead of calculate leap years

The is_leap_year() for determining leap year is provided in rtc lib.
This uses is_leap_year() instead of its own leap year determination
routine.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@...auri.org>
---
 drivers/rtc/rtc-mc146818-lib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-mc146818-lib.c b/drivers/rtc/rtc-mc146818-lib.c
index 651bf3c279c74..ce4d68de05831 100644
--- a/drivers/rtc/rtc-mc146818-lib.c
+++ b/drivers/rtc/rtc-mc146818-lib.c
@@ -232,8 +232,7 @@ int mc146818_set_time(struct rtc_time *time)
 
 #ifdef CONFIG_MACH_DECSTATION
 	real_yrs = yrs;
-	leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) ||
-			!((yrs + 1900) % 400));
+	leap_yr = is_leap_year(yrs + 1900);
 	yrs = 72;
 
 	/*
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ