Commit 0310b1bc authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman

staging: brcm80211: remove brcmf_find_msb() function

This function is similar to ffs() wihch is provided by the linux
kernel already. This patch replaces brcmf_find_msb() with ffs().
Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 206a443f
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bitops.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/ieee80211.h> #include <linux/ieee80211.h>
#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_func.h>
...@@ -293,11 +294,6 @@ static s32 brcmf_iscan_pending(struct brcmf_cfg80211_priv *cfg_priv); ...@@ -293,11 +294,6 @@ static s32 brcmf_iscan_pending(struct brcmf_cfg80211_priv *cfg_priv);
static s32 brcmf_iscan_inprogress(struct brcmf_cfg80211_priv *cfg_priv); static s32 brcmf_iscan_inprogress(struct brcmf_cfg80211_priv *cfg_priv);
static s32 brcmf_iscan_aborted(struct brcmf_cfg80211_priv *cfg_priv); static s32 brcmf_iscan_aborted(struct brcmf_cfg80211_priv *cfg_priv);
/*
* find most significant bit set
*/
static __used u32 brcmf_find_msb(u16 bit16);
/* /*
* update pmklist to dongle * update pmklist to dongle
*/ */
...@@ -2008,33 +2004,6 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, ...@@ -2008,33 +2004,6 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
return err; return err;
} }
static __used u32 brcmf_find_msb(u16 bit16)
{
u32 ret = 0;
if (bit16 & 0xff00) {
ret += 8;
bit16 >>= 8;
}
if (bit16 & 0xf0) {
ret += 4;
bit16 >>= 4;
}
if (bit16 & 0xc) {
ret += 2;
bit16 >>= 2;
}
if (bit16 & 2)
ret += bit16 & 2;
else if (bit16)
ret += bit16;
return ret;
}
static s32 static s32
brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
const u8 *addr, const u8 *addr,
...@@ -2062,10 +2031,10 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev, ...@@ -2062,10 +2031,10 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
rateset.count = le32_to_cpu(rateset.count); rateset.count = le32_to_cpu(rateset.count);
legacy = brcmf_find_msb(mask->control[IEEE80211_BAND_2GHZ].legacy); legacy = ffs(mask->control[IEEE80211_BAND_2GHZ].legacy & 0xFFFF);
if (!legacy) if (!legacy)
legacy = brcmf_find_msb( legacy = ffs(mask->control[IEEE80211_BAND_5GHZ].legacy &
mask->control[IEEE80211_BAND_5GHZ].legacy); 0xFFFF);
val = wl_g_rates[legacy - 1].bitrate * 100000; val = wl_g_rates[legacy - 1].bitrate * 100000;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment