Re: 2.6.25-rc3: "__divdi3" [drivers/crypto/hifn_795x.ko] undefined!

Patrick McHardy
2008-02-26T12:29:39Z

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

Martin Michlmayr wrote:
> With 2.6.25-rc3 and a config file with
>
> CONFIG_CRYPTO_DEV_HIFN_795X=m
> CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
>
> I get the following build error on at least ARM and MIPS:
>
> Building modules, stage 2.
> MODPOST 759 modules
> ERROR: "__divdi3" [drivers/crypto/hifn_795x.ko] undefined!
>

Does this patch fix it?

[-- Attachment #2: x --]
[-- Type: text/plain, Size: 590 bytes --]

diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index 3110bf7..92c53ce 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -825,8 +825,8 @@ static int hifn_register_rng(struct hifn_device *dev)
/*
* We must wait at least 256 Pk_clk cycles between two reads of the rng.
*/
- dev->rng_wait_time = DIV_ROUND_UP(NSEC_PER_SEC, dev->pk_clk_freq) *
- 256;
+ dev->rng_wait_time = DIV_ROUND_UP((unsigned int)NSEC_PER_SEC,
+ dev->pk_clk_freq) * 256;

dev->rng.name = dev->name;
dev->rng.data_present = hifn_rng_data_present,