Search Linux Wireless

Re: [PATCH] p54: Use do_div for 64-bit division to fix 32-bit kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux