REPOST PATCH: hpet_do_div.patch

From: Jon Smirl
Date: Thu Jun 23 2005 - 16:21:20 EST


This patch does not appear to be in the mm or linus kernel. It has
been approved by the HPET maintainer.

On 6/14/05, Pallipadi, Venkatesh <venkatesh.pallipadi@xxxxxxxxx> wrote:
>
> Yes. It has to be plain '/' instead of do_div. Even the
> femto second quantity is guaranteed to fit in 32 bit
> variable here.
>
> Thanks,
> Venki

--
Jon Smirl
jonsmirl@xxxxxxxxx

#Use correct div on 32 bits
#Signed-off-by: Jon Smirl <jonsmirl@xxxxxxxxx>
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -834,7 +834,7 @@ int hpet_alloc(struct hpet_data *hdp)
printk("\n");

ns = hpetp->hp_period; /* femptoseconds, 10^-15 */
- do_div(ns, 1000000); /* convert to nanoseconds, 10^-9 */
+ ns /= 1000000; /* convert to nanoseconds, 10^-9 */
printk(KERN_INFO "hpet%d: %ldns tick, %d %d-bit timers\n",
hpetp->hp_which, ns, hpetp->hp_ntimer,
cap & HPET_COUNTER_SIZE_MASK ? 64 : 32);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/