提交 857c0fc4 编写于 作者: R Rafał Miłecki 提交者: John W. Linville

b43: use standard fls for finding the most significant bit

Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 e239d859
...@@ -1710,19 +1710,6 @@ static const struct lpphy_rx_iq_comp lpphy_rev2plus_iq_comp = { ...@@ -1710,19 +1710,6 @@ static const struct lpphy_rx_iq_comp lpphy_rev2plus_iq_comp = {
.c0 = 0, .c0 = 0,
}; };
static u8 lpphy_nbits(s32 val)
{
u32 tmp = abs(val);
u8 nbits = 0;
while (tmp != 0) {
nbits++;
tmp >>= 1;
}
return nbits;
}
static int lpphy_calc_rx_iq_comp(struct b43_wldev *dev, u16 samples) static int lpphy_calc_rx_iq_comp(struct b43_wldev *dev, u16 samples)
{ {
struct lpphy_iq_est iq_est; struct lpphy_iq_est iq_est;
...@@ -1749,8 +1736,8 @@ static int lpphy_calc_rx_iq_comp(struct b43_wldev *dev, u16 samples) ...@@ -1749,8 +1736,8 @@ static int lpphy_calc_rx_iq_comp(struct b43_wldev *dev, u16 samples)
goto out; goto out;
} }
prod_msb = lpphy_nbits(prod); prod_msb = fls(abs(prod));
q_msb = lpphy_nbits(qpwr); q_msb = fls(abs(qpwr));
tmp1 = prod_msb - 20; tmp1 = prod_msb - 20;
if (tmp1 >= 0) { if (tmp1 >= 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册