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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <11588860852885-git-send-email-dmitriyz@google.com>
Date:	Thu, 21 Sep 2006 17:48:03 -0700
From:	Dmitriy Zavin <dmitriyz@...gle.com>
To:	linux-kernel@...r.kernel.org
Cc:	ak@...e.de, akpm@...l.org
Subject: [PATCH 3/4] therm_throt: Make the jiffies compares use the 64bit safe macros.

Signed-off-by: Dmitriy Zavin <dmitriyz@...gle.com>

---
 arch/i386/kernel/cpu/mcheck/therm_throt.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/i386/kernel/cpu/mcheck/therm_throt.c b/arch/i386/kernel/cpu/mcheck/therm_throt.c
index 85eba00..101f7ac 100644
--- a/arch/i386/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/i386/kernel/cpu/mcheck/therm_throt.c
@@ -18,7 +18,7 @@ #include <asm/therm_throt.h>
 /* How long to wait between reporting thermal events */
 #define CHECK_INTERVAL              (300 * HZ)
 
-static DEFINE_PER_CPU(unsigned long, next_check);
+static DEFINE_PER_CPU(__u64, next_check);
 
 /***
  * therm_throt_process - Process thermal throttling event
@@ -39,11 +39,12 @@ static DEFINE_PER_CPU(unsigned long, nex
 int therm_throt_process(int curr)
 {
 	unsigned int cpu = smp_processor_id();
+	__u64 tmp_jiffs = get_jiffies_64();
 
-	if (time_before(jiffies, __get_cpu_var(next_check)))
+	if (time_before64(tmp_jiffs, __get_cpu_var(next_check)))
 		return 0;
 
-	__get_cpu_var(next_check) = jiffies + CHECK_INTERVAL;
+	__get_cpu_var(next_check) = tmp_jiffs + CHECK_INTERVAL;
 
 	/* if we just entered the thermal event */
 	if (curr) {
-- 
1.4.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ