staging: rtl8192u: fix bitshift calculation in r819xU_phy.c
This patch uses the ffs linux built-in routine in the computation of the bitshift to take advantage of architecture specific instructions that implement this computation more efficiently. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
409359a12d
commit
391c72a30b
1 changed files with 3 additions and 5 deletions
|
@ -7,6 +7,8 @@
|
||||||
#include "r819xU_firmware_img.h"
|
#include "r819xU_firmware_img.h"
|
||||||
|
|
||||||
#include "dot11d.h"
|
#include "dot11d.h"
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
|
||||||
static u32 RF_CHANNEL_TABLE_ZEBRA[] = {
|
static u32 RF_CHANNEL_TABLE_ZEBRA[] = {
|
||||||
0,
|
0,
|
||||||
0x085c, //2412 1
|
0x085c, //2412 1
|
||||||
|
@ -45,11 +47,7 @@ static u32 RF_CHANNEL_TABLE_ZEBRA[] = {
|
||||||
u32 rtl8192_CalculateBitShift(u32 dwBitMask)
|
u32 rtl8192_CalculateBitShift(u32 dwBitMask)
|
||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
for (i=0; i<=31; i++)
|
i = ffs(dwBitMask) - 1;
|
||||||
{
|
|
||||||
if (((dwBitMask>>i)&0x1) == 1)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
|
Loading…
Add table
Reference in a new issue