Re: [patch 2.6.27-rc1] /dev/hpet - fixes and cleanup

From: David Brownell
Date: Thu Jul 31 2008 - 16:00:16 EST


On Thursday 31 July 2008, Ingo Molnar wrote:
>   drivers/built-in.o: In function `hpet_alloc':
>   : undefined reference to `__udivdi3'
>   drivers/built-in.o: In function `hpet_alloc':
>   : undefined reference to `__umoddi3'

Verified on 64 and 32 bit builds.

Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

--- a/drivers/char/hpet.c 2008-07-31 11:22:07.000000000 -0700
+++ b/drivers/char/hpet.c 2008-07-31 11:21:15.000000000 -0700
@@ -701,6 +701,7 @@ int hpet_alloc(struct hpet_data *hdp)
static struct hpets *last = NULL;
unsigned long period;
unsigned long long temp;
+ u32 remainder;

/*
* hpet_alloc can be called by platform dependent code.
@@ -764,12 +765,13 @@ int hpet_alloc(struct hpet_data *hdp)
printk("%s %d", i > 0 ? "," : "", hdp->hd_irq[i]);
printk("\n");

+ temp = hpetp->hp_tick_freq;
+ remainder = do_div(temp, 1000000);
printk(KERN_INFO
"hpet%u: %u comparators, %d-bit %u.%06u MHz counter\n",
hpetp->hp_which, hpetp->hp_ntimer,
cap & HPET_COUNTER_SIZE_MASK ? 64 : 32,
- (unsigned) (hpetp->hp_tick_freq / 1000000),
- (unsigned) (hpetp->hp_tick_freq % 1000000));
+ (unsigned) temp, remainder);

mcfg = readq(&hpet->hpet_config);
if ((mcfg & HPET_ENABLE_CNF_MASK) == 0) {

--
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/