mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org, davidm@hpl.hp.com
Subject: [PATCH][RESEND] better compat_jiffies_to_clock_t
Date: Fri, 3 Jan 2003 11:24:01 +1100	[thread overview]
Message-ID: <20030103112401.04705990.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20021217152554.5b4b66f1.sfr@canb.auug.org.au>

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;

      reply	other threads:[~2003-01-03  0:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-17  4:25 [PATCH] " Stephen Rothwell
2003-01-03  0:24 ` Stephen Rothwell [this message]

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=20030103112401.04705990.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®