From: Andrew Morton <akpm@linux-foundation.org>
To: David Rientjes <rientjes@google.com>
Cc: tbm@cyrius.com, linux-kernel@vger.kernel.org,
johnpol@2ka.mipt.ru, herbert@gondor.apana.org.au,
ralf@linux-mips.org, kaber@trash.net
Subject: Re: 2.6.25-rc3: "__divdi3" [drivers/crypto/hifn_795x.ko] undefined!
Date: Thu, 28 Feb 2008 11:40:41 -0800 [thread overview]
Message-ID: <20080228114041.2fc51217.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0802261945370.22324@chino.kir.corp.google.com>
On Tue, 26 Feb 2008 19:46:35 -0800 (PST)
David Rientjes <rientjes@google.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@trash.net>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Signed-off-by: David Rientjes <rientjes@google.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 "/".
next prev parent reply other threads:[~2008-02-28 20:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-26 12:21 2.6.25-rc3: "__divdi3" [drivers/crypto/hifn_795x.ko] undefined! Martin Michlmayr
2008-02-26 12:28 ` Patrick McHardy
2008-02-26 13:39 ` Martin Michlmayr
2008-02-26 15:34 ` [2.6.25 patch] drivers/crypto/hifn_795x.c: fix 64bit division Adrian Bunk
2008-02-26 17:20 ` Martin Michlmayr
2008-02-26 18:52 ` Evgeniy Polyakov
2008-02-27 0:04 ` Andrew Morton
2008-02-27 6:22 ` Adrian Bunk
2008-02-27 6:47 ` Andrew Morton
2008-02-28 8:02 ` Adrian Bunk
2008-02-27 15:59 ` Evgeniy Polyakov
2008-02-27 3:46 ` 2.6.25-rc3: "__divdi3" [drivers/crypto/hifn_795x.ko] undefined! David Rientjes
2008-02-27 11:29 ` Patrick McHardy
2008-02-28 19:40 ` Andrew Morton [this message]
2008-02-27 14:53 ` Ralf Baechle
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=20080228114041.2fc51217.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=johnpol@2ka.mipt.ru \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=rientjes@google.com \
--cc=tbm@cyrius.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