aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/scan.c
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2011-04-15 23:50:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-19 15:38:04 -0400
commit636c4598499eeacce0893dc8d91113b904bd531e (patch)
tree51a34367eb3184d5c45ee84f0e5be0bf9d873efa /drivers/net/wireless/mwifiex/scan.c
parent7762bb02ce13c191e0a2da159bcb8d9b374b88c4 (diff)
mwifiex: remove redundant local variables and comments
Remove some local variables (mainly function return values) that are used only once. Also, one dummy function and some wordy comments are removed. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r--drivers/net/wireless/mwifiex/scan.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 84742715893f..68d905d58606 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -181,7 +181,6 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv,
181 struct mwifiex_ssid_bssid *ssid_bssid) 181 struct mwifiex_ssid_bssid *ssid_bssid)
182{ 182{
183 struct mwifiex_ssid_bssid tmp_ssid_bssid; 183 struct mwifiex_ssid_bssid tmp_ssid_bssid;
184 int ret = 0;
185 u8 *mac = NULL; 184 u8 *mac = NULL;
186 185
187 if (!ssid_bssid) 186 if (!ssid_bssid)
@@ -189,17 +188,17 @@ int mwifiex_find_best_bss(struct mwifiex_private *priv,
189 188
190 memcpy(&tmp_ssid_bssid, ssid_bssid, 189 memcpy(&tmp_ssid_bssid, ssid_bssid,
191 sizeof(struct mwifiex_ssid_bssid)); 190 sizeof(struct mwifiex_ssid_bssid));
192 ret = mwifiex_bss_ioctl_find_bss(priv, &tmp_ssid_bssid);
193 191
194 if (!ret) { 192 if (!mwifiex_bss_ioctl_find_bss(priv, &tmp_ssid_bssid)) {
195 memcpy(ssid_bssid, &tmp_ssid_bssid, 193 memcpy(ssid_bssid, &tmp_ssid_bssid,
196 sizeof(struct mwifiex_ssid_bssid)); 194 sizeof(struct mwifiex_ssid_bssid));
197 mac = (u8 *) &ssid_bssid->bssid; 195 mac = (u8 *) &ssid_bssid->bssid;
198 dev_dbg(priv->adapter->dev, "cmd: found network: ssid=%s," 196 dev_dbg(priv->adapter->dev, "cmd: found network: ssid=%s,"
199 " %pM\n", ssid_bssid->ssid.ssid, mac); 197 " %pM\n", ssid_bssid->ssid.ssid, mac);
198 return 0;
200 } 199 }
201 200
202 return ret; 201 return -1;
203} 202}
204 203
205/* 204/*
@@ -2061,19 +2060,13 @@ mwifiex_process_scan_results(struct mwifiex_private *priv)
2061static u8 2060static u8
2062mwifiex_radio_type_to_band(u8 radio_type) 2061mwifiex_radio_type_to_band(u8 radio_type)
2063{ 2062{
2064 u8 ret_band;
2065
2066 switch (radio_type) { 2063 switch (radio_type) {
2067 case HostCmd_SCAN_RADIO_TYPE_A: 2064 case HostCmd_SCAN_RADIO_TYPE_A:
2068 ret_band = BAND_A; 2065 return BAND_A;
2069 break;
2070 case HostCmd_SCAN_RADIO_TYPE_BG: 2066 case HostCmd_SCAN_RADIO_TYPE_BG:
2071 default: 2067 default:
2072 ret_band = BAND_G; 2068 return BAND_G;
2073 break;
2074 } 2069 }
2075
2076 return ret_band;
2077} 2070}
2078 2071
2079/* 2072/*
@@ -2226,8 +2219,7 @@ static int
2226mwifiex_scan_delete_ssid_table_entry(struct mwifiex_private *priv, 2219mwifiex_scan_delete_ssid_table_entry(struct mwifiex_private *priv,
2227 struct mwifiex_802_11_ssid *del_ssid) 2220 struct mwifiex_802_11_ssid *del_ssid)
2228{ 2221{
2229 int ret = -1; 2222 s32 table_idx = -1;
2230 s32 table_idx;
2231 2223
2232 dev_dbg(priv->adapter->dev, "info: scan: delete ssid entry: %-32s\n", 2224 dev_dbg(priv->adapter->dev, "info: scan: delete ssid entry: %-32s\n",
2233 del_ssid->ssid); 2225 del_ssid->ssid);
@@ -2240,11 +2232,10 @@ mwifiex_scan_delete_ssid_table_entry(struct mwifiex_private *priv,
2240 dev_dbg(priv->adapter->dev, 2232 dev_dbg(priv->adapter->dev,
2241 "info: Scan: Delete SSID Entry: Found Idx = %d\n", 2233 "info: Scan: Delete SSID Entry: Found Idx = %d\n",
2242 table_idx); 2234 table_idx);
2243 ret = 0;
2244 mwifiex_scan_delete_table_entry(priv, table_idx); 2235 mwifiex_scan_delete_table_entry(priv, table_idx);
2245 } 2236 }
2246 2237
2247 return ret; 2238 return table_idx == -1 ? -1 : 0;
2248} 2239}
2249 2240
2250/* 2241/*