Linux wireless drivers development
 help / color / mirror / Atom feed
From: Calvin Walton <calvin.walton@kepstin.ca>
To: Christian Lamparter <chunkeey@googlemail.com>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com
Subject: Re: [PATCH] p54: Use do_div for 64-bit division to fix 32-bit kernels
Date: Wed, 07 Sep 2011 00:27:13 -0400	[thread overview]
Message-ID: <1315369635.3089.1.camel@ayu> (raw)
In-Reply-To: <201108252347.35706.chunkeey@googlemail.com>

On Thu, 2011-08-25 at 23:47 +0200, Christian Lamparter wrote:
> Use the do_div macro for 64-bit division. Otherwise, the module will
> reference __udivdi3 under 32-bit kernels, which is not allowed in
> kernel space.
> 
> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
> ---
> diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c

> +		do_div(survey->channel_time, 1024);
> +		do_div(survey->channel_time_tx, 1024);
> +		do_div(survey->channel_time_busy, 1024);

You're doing a division by a power of two here, why not just use a
bit-shift operation ">> 10" instead of a full division operation?

-- 
Calvin Walton <calvin.walton@kepstin.ca>


      reply	other threads:[~2011-09-07  4:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 21:47 [PATCH] p54: Use do_div for 64-bit division to fix 32-bit kernels Christian Lamparter
2011-09-07  4:27 ` Calvin Walton [this message]

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=1315369635.3089.1.camel@ayu \
    --to=calvin.walton@kepstin.ca \
    --cc=chunkeey@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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