[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20080228114041.2fc51217.akpm@linux-foundation.org>
Date: Thu, 28 Feb 2008 11:40:41 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: David Rientjes <rientjes@...gle.com>
Cc: tbm@...ius.com, linux-kernel@...r.kernel.org, johnpol@....mipt.ru,
herbert@...dor.apana.org.au, ralf@...ux-mips.org, kaber@...sh.net
Subject: Re: 2.6.25-rc3: "__divdi3" [drivers/crypto/hifn_795x.ko] undefined!
On Tue, 26 Feb 2008 19:46:35 -0800 (PST)
David Rientjes <rientjes@...gle.com> wrote:
> On Tue, 26 Feb 2008, 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!
> >
>
> crypto: use do_div() when registering the rng
>
> Use do_div() instead of the divide operator.
>
> Cc: Patrick McHardy <kaber@...sh.net>
> Cc: Herbert Xu <herbert@...dor.apana.org.au>
> Signed-off-by: David Rientjes <rientjes@...gle.com>
> ---
> Looks like this was triggered by f881d829, which causes this code to be
> compiled for CONFIG_CRYPTO_DEV_HIFN_795X_RNG.
>
> drivers/crypto/hifn_795x.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
> --- a/drivers/crypto/hifn_795x.c
> +++ b/drivers/crypto/hifn_795x.c
> @@ -822,12 +822,14 @@ static int hifn_rng_data_read(struct hwrng *rng, u32 *data)
>
> static int hifn_register_rng(struct hifn_device *dev)
> {
> + unsigned int tmp;
> +
> /*
> * 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;
> -
> + tmp = NSEC_PER_SEC + dev->pk_clk_freq - 1;
> + do_div(tmp, dev->pk_clk_freq);
> + dev->rng_wait_time = tmp * 256;
> dev->rng.name = dev->name;
> dev->rng.data_present = hifn_rng_data_present,
> dev->rng.data_read = hifn_rng_data_read,
do_div takes a u64 as its first arg. If we're going to make the above
change then we may as well use plain old "/".
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists