public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Makhlis, Lev" <Lev_Makhlis@bmc.com>
To: nacc@us.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 19/34]: include/jiffies: add usecs_to_jiffies() functi on
Date: Thu, 3 Feb 2005 10:07:15 -0600	[thread overview]
Message-ID: <1107446835.7087.8.camel@levlinux.boston.bmc.com> (raw)

Nishanth Aravamudan <nacc@us.ibm.com> wrote:

> +static inline unsigned long usecs_to_jiffies(const unsigned int u)
> +{
> +	if (u > jiffies_to_usecs(MAX_JIFFY_OFFSET))
> +		return MAX_JIFFY_OFFSET;
> +#if HZ <= 1000 && !(1000 % HZ)
> +	return (u + (1000000 / HZ) - 1000) / (1000000 / HZ);
> +#elif HZ > 1000 && !(HZ % 1000)
> +	return u * (HZ / 1000000);
> +#else
> +	return (u * HZ + 999999) / 1000000;
> +#endif
> +}

Shouldn't this use 1000000 instead of 1000 everywhere?
It returns 0 if HZ=10000.

             reply	other threads:[~2005-02-03 16:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-03 16:07 Makhlis, Lev [this message]
2005-02-03 18:48 ` [UPDATE PATCH 19/34]: include/jiffies: add usecs_to_jiffies() function Nishanth Aravamudan
2005-02-04  1:11   ` [UPDATE PATCH]: include/jiffies: fix usecs_to_jiffies()/jiffies_to_usecs() math Nishanth Aravamudan

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=1107446835.7087.8.camel@levlinux.boston.bmc.com \
    --to=lev_makhlis@bmc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nacc@us.ibm.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