mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] better compat_jiffies_to_clock_t
@ 2002-12-17  4:25 Stephen Rothwell
  2003-01-03  0:24 ` [PATCH][RESEND] " Stephen Rothwell
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2002-12-17  4:25 UTC (permalink / raw)
  To: Linus; +Cc: LKML, davidm

Hi Linus,

At David Mosberger's suggestion can we use this new version of
compat_jiffies_to_clock_t?  It does better rounding and will not fail
if COMPAT_USER_HZ > HZ.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.52-32bit.base/include/linux/compat.h 2.5.52-32bit.clock/include/linux/compat.h
--- 2.5.52-32bit.base/include/linux/compat.h	2002-12-16 14:49:54.000000000 +1100
+++ 2.5.52-32bit.clock/include/linux/compat.h	2002-12-17 15:20:18.000000000 +1100
@@ -9,9 +9,11 @@
 #ifdef CONFIG_COMPAT
 
 #include <linux/stat.h>
+#include <linux/param.h>	/* for HZ */
 #include <asm/compat.h>
 
-#define compat_jiffies_to_clock_t(x)	((x) / (HZ / COMPAT_USER_HZ))
+#define compat_jiffies_to_clock_t(x)	\
+		(((unsigned long long)(x) * COMPAT_USER_HZ) / HZ)
 
 struct compat_utimbuf {
 	compat_time_t		actime;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH][RESEND] better compat_jiffies_to_clock_t
  2002-12-17  4:25 [PATCH] better compat_jiffies_to_clock_t Stephen Rothwell
@ 2003-01-03  0:24 ` Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2003-01-03  0:24 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, davidm

Hi Linus,

At David Mosberger's suggestion can we use this new version of
compat_jiffies_to_clock_t?  It does better rounding and will not fail
if COMPAT_USER_HZ > HZ.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.54-200301030805/include/linux/compat.h 2.5.54-200301030805-clock/include/linux/compat.h
--- 2.5.54-200301030805/include/linux/compat.h	2002-12-16 14:49:54.000000000 +1100
+++ 2.5.54-200301030805-clock/include/linux/compat.h	2003-01-03 11:19:52.000000000 +1100
@@ -9,9 +9,11 @@
 #ifdef CONFIG_COMPAT
 
 #include <linux/stat.h>
+#include <linux/param.h>	/* for HZ */
 #include <asm/compat.h>
 
-#define compat_jiffies_to_clock_t(x)	((x) / (HZ / COMPAT_USER_HZ))
+#define compat_jiffies_to_clock_t(x)	\
+		(((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
 
 struct compat_utimbuf {
 	compat_time_t		actime;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-03  0:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-17  4:25 [PATCH] better compat_jiffies_to_clock_t Stephen Rothwell
2003-01-03  0:24 ` [PATCH][RESEND] " Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®