Commit 648cd9a6 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: fix line over 80 char in cfg_scan_result()

Refactor cfg_scan_result() API to avoid 'line over 80 chars' issue
reported by checkpatch.pl script.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7d615927
...@@ -374,11 +374,13 @@ static void cfg_scan_result(enum scan_event scan_event, ...@@ -374,11 +374,13 @@ static void cfg_scan_result(enum scan_event scan_event,
struct cfg80211_bss *bss = NULL; struct cfg80211_bss *bss = NULL;
priv = user_void; priv = user_void;
if (priv->cfg_scanning) { if (!priv->cfg_scanning)
return;
if (scan_event == SCAN_EVENT_NETWORK_FOUND) { if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
wiphy = priv->dev->ieee80211_ptr->wiphy; wiphy = priv->dev->ieee80211_ptr->wiphy;
if (!wiphy) if (!wiphy || !network_info)
return; return;
if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC && if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
...@@ -386,20 +388,24 @@ static void cfg_scan_result(enum scan_event scan_event, ...@@ -386,20 +388,24 @@ static void cfg_scan_result(enum scan_event scan_event,
((s32)network_info->rssi * 100) > 100)) ((s32)network_info->rssi * 100) > 100))
return; return;
if (network_info) { s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch,
s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch, NL80211_BAND_2GHZ); NL80211_BAND_2GHZ);
channel = ieee80211_get_channel(wiphy, s32Freq); channel = ieee80211_get_channel(wiphy, s32Freq);
if (!channel) if (!channel)
return; return;
if (network_info->new_network) { if (network_info->new_network) {
if (priv->rcvd_ch_cnt < MAX_NUM_SCANNED_NETWORKS) { if (priv->rcvd_ch_cnt >= MAX_NUM_SCANNED_NETWORKS)
return;
priv->rcvd_ch_cnt++; priv->rcvd_ch_cnt++;
add_network_to_shadow(network_info, priv, join_params); add_network_to_shadow(network_info, priv, join_params);
if (!(memcmp("DIRECT-", network_info->ssid, 7))) { if (memcmp("DIRECT-", network_info->ssid, 7))
return;
bss = cfg80211_inform_bss(wiphy, bss = cfg80211_inform_bss(wiphy,
channel, channel,
CFG80211_BSS_FTYPE_UNKNOWN, CFG80211_BSS_FTYPE_UNKNOWN,
...@@ -412,19 +418,20 @@ static void cfg_scan_result(enum scan_event scan_event, ...@@ -412,19 +418,20 @@ static void cfg_scan_result(enum scan_event scan_event,
(s32)network_info->rssi * 100, (s32)network_info->rssi * 100,
GFP_KERNEL); GFP_KERNEL);
cfg80211_put_bss(wiphy, bss); cfg80211_put_bss(wiphy, bss);
}
}
} else { } else {
u32 i; u32 i;
for (i = 0; i < priv->rcvd_ch_cnt; i++) { for (i = 0; i < priv->rcvd_ch_cnt; i++) {
if (memcmp(last_scanned_shadow[i].bssid, network_info->bssid, 6) == 0) { if (memcmp(last_scanned_shadow[i].bssid,
last_scanned_shadow[i].rssi = network_info->rssi; network_info->bssid, 6) == 0)
last_scanned_shadow[i].time_scan = jiffies;
break; break;
} }
}
} if (i >= priv->rcvd_ch_cnt)
return;
last_scanned_shadow[i].rssi = network_info->rssi;
last_scanned_shadow[i].time_scan = jiffies;
} }
} else if (scan_event == SCAN_EVENT_DONE) { } else if (scan_event == SCAN_EVENT_DONE) {
refresh_scan(priv, false); refresh_scan(priv, false);
...@@ -459,7 +466,6 @@ static void cfg_scan_result(enum scan_event scan_event, ...@@ -459,7 +466,6 @@ static void cfg_scan_result(enum scan_event scan_event,
} }
mutex_unlock(&priv->scan_req_lock); mutex_unlock(&priv->scan_req_lock);
} }
}
} }
int wilc_connecting; int wilc_connecting;
......
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