From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Linus <torvalds@transmeta.com>
Cc: LKML <linux-kernel@vger.kernel.org>, davidm@hpl.hp.com
Subject: [PATCH] better compat_jiffies_to_clock_t
Date: Tue, 17 Dec 2002 15:25:54 +1100 [thread overview]
Message-ID: <20021217152554.5b4b66f1.sfr@canb.auug.org.au> (raw)
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;
next reply other threads:[~2002-12-17 4:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-17 4:25 Stephen Rothwell [this message]
2003-01-03 0:24 ` [PATCH][RESEND] " Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021217152554.5b4b66f1.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=davidm@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®