lkml.org 
[lkml]   [2003]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][RESEND] better compat_jiffies_to_clock_t
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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.058 / U:0.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site