Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+77 −71
Original line number Diff line number Diff line
@@ -374,11 +374,13 @@ static void cfg_scan_result(enum scan_event scan_event,
	struct cfg80211_bss *bss = NULL;

	priv = user_void;
	if (priv->cfg_scanning) {
	if (!priv->cfg_scanning)
		return;

	if (scan_event == SCAN_EVENT_NETWORK_FOUND) {
		wiphy = priv->dev->ieee80211_ptr->wiphy;

			if (!wiphy)
		if (!wiphy || !network_info)
			return;

		if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
@@ -386,20 +388,24 @@ static void cfg_scan_result(enum scan_event scan_event,
		    ((s32)network_info->rssi * 100) > 100))
			return;

			if (network_info) {
				s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch, NL80211_BAND_2GHZ);
		s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch,
							 NL80211_BAND_2GHZ);
		channel = ieee80211_get_channel(wiphy, s32Freq);

		if (!channel)
			return;

		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++;

			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,
						  channel,
						  CFG80211_BSS_FTYPE_UNKNOWN,
@@ -412,19 +418,20 @@ static void cfg_scan_result(enum scan_event scan_event,
						  (s32)network_info->rssi * 100,
						  GFP_KERNEL);
			cfg80211_put_bss(wiphy, bss);
						}
					}
		} else {
			u32 i;

			for (i = 0; i < priv->rcvd_ch_cnt; i++) {
						if (memcmp(last_scanned_shadow[i].bssid, network_info->bssid, 6) == 0) {
							last_scanned_shadow[i].rssi = network_info->rssi;
							last_scanned_shadow[i].time_scan = jiffies;
				if (memcmp(last_scanned_shadow[i].bssid,
					   network_info->bssid, 6) == 0)
					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) {
		refresh_scan(priv, false);
@@ -460,7 +467,6 @@ static void cfg_scan_result(enum scan_event scan_event,
		mutex_unlock(&priv->scan_req_lock);
	}
}
}

int wilc_connecting;