wifi_drv: fix find_next_bit function
Among others, this function is used in the for_each_set_big() macro, which is used when configuring the data rate tables. Therefore, this fixes observed performance issues. Fixes #1439.
This commit is contained in:
parent
f94176af3f
commit
7923b287d9
|
@ -1486,20 +1486,14 @@ void put_page(struct page *page)
|
||||||
unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
|
unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
|
||||||
unsigned long offset)
|
unsigned long offset)
|
||||||
{
|
{
|
||||||
unsigned long i, j;
|
unsigned long i = offset / BITS_PER_LONG;
|
||||||
|
offset -= (i * BITS_PER_LONG);
|
||||||
|
|
||||||
for (i = offset; i < (size / BITS_PER_LONG); i++)
|
for (; offset < size; offset++)
|
||||||
if (addr[i] == ~0UL)
|
if (addr[i] & (1UL << offset))
|
||||||
break;
|
return offset;
|
||||||
|
|
||||||
if (i == size)
|
return size;
|
||||||
return size;
|
|
||||||
|
|
||||||
for (j = 0; j < BITS_PER_LONG; j++)
|
|
||||||
if ((addr[i]) & (1UL << j))
|
|
||||||
break;
|
|
||||||
|
|
||||||
return (i * BITS_PER_LONG) + j;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue