public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: jak@rudolph.ccur.com (Joe Korty)
To: vojtech@suse.cz (Vojtech Pavlik)
Cc: george@mvista.com (george anzinger),
	bjorn_helgaas@hp.com (Bjorn Helgaas),
	marcelo@conectiva.com.br (Marcelo Tosatti),
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] joydev: fix HZ->millisecond transformation
Date: Fri, 20 Dec 2002 09:52:28 -0500 (EST)	[thread overview]
Message-ID: <200212201452.OAA10431@rudolph.ccur.com> (raw)
In-Reply-To: <20021220142443.A26184@ucw.cz> from "Vojtech Pavlik" at Dec 20, 2002 02:24:43 PM

[ repost -- I am going to have to get outgoing mail fixed on my lkml-reading
 machine ]

> On Fri, Dec 20, 2002 at 02:41:50AM -0800, george anzinger wrote:
>> Bjorn Helgaas wrote:
>>> 
>>> * fix a problem with HZ->millisecond transformation on
>>>   non-x86 archs (from 2.5 change by vojtech@suse.cz)
>>> [...]
>>> +#define MSECS(t)       (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
>>> [...]
> Though it might be easier to say (1000 * t) / HZ, now that I think about
> it.

The more complex version avoids integer overflow for more values of 't'
in the (1000 * t) subexpression.

Joe

  reply	other threads:[~2002-12-20 14:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-16 19:27 [PATCH] joydev: fix HZ->millisecond transformation Bjorn Helgaas
2002-12-20 10:41 ` george anzinger
2002-12-20 13:24   ` Vojtech Pavlik
2002-12-20 14:52     ` Joe Korty [this message]
2002-12-20 17:24     ` george anzinger
2002-12-20 17:35       ` Vojtech Pavlik
2002-12-20 18:16         ` george anzinger
2002-12-21  9:18           ` Vojtech Pavlik
2002-12-21 16:46             ` george anzinger

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=200212201452.OAA10431@rudolph.ccur.com \
    --to=jak@rudolph.ccur.com \
    --cc=bjorn_helgaas@hp.com \
    --cc=george@mvista.com \
    --cc=joe.korty@ccur.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=vojtech@suse.cz \
    /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