diff options
author | Ajay Singh <ajay.kathat@microchip.com> | 2018-05-11 13:43:14 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-14 14:04:48 +0200 |
commit | 30300a1cbd4ce2df28abc62b087ef18bb379ec7f (patch) | |
tree | 38f02f373cdabfc2a2e285a71e5edaadab2e0830 | |
parent | 50fdf8142db25fdc69c16b54b389aeca5f1af041 (diff) |
staging: wilc1000: fix line over 80 chars in add_network_to_shadow()
Fix line over 80 characters issue reported by checkpatch in
add_network_to_shadow() by using temporary variable.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 9afba4d8945f..c730323cab87 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -300,6 +300,7 @@ static void add_network_to_shadow(struct network_info *nw_info, int ap_found = is_network_in_shadow(nw_info, user_void); u32 ap_index = 0; u8 rssi_index = 0; + struct network_info *shadow_nw_info; if (last_scanned_cnt >= MAX_NUM_SCANNED_NETWORKS_SHADOW) return; @@ -310,37 +311,34 @@ static void add_network_to_shadow(struct network_info *nw_info, } else { ap_index = ap_found; } - rssi_index = last_scanned_shadow[ap_index].rssi_history.index; - last_scanned_shadow[ap_index].rssi_history.samples[rssi_index++] = nw_info->rssi; + shadow_nw_info = &last_scanned_shadow[ap_index]; + rssi_index = shadow_nw_info->rssi_history.index; + shadow_nw_info->rssi_history.samples[rssi_index++] = nw_info->rssi; if (rssi_index == NUM_RSSI) { rssi_index = 0; - last_scanned_shadow[ap_index].rssi_history.full = true; - } - last_scanned_shadow[ap_index].rssi_history.index = rssi_index; - last_scanned_shadow[ap_index].rssi = nw_info->rssi; - last_scanned_shadow[ap_index].cap_info = nw_info->cap_info; - last_scanned_shadow[ap_index].ssid_len = nw_info->ssid_len; - memcpy(last_scanned_shadow[ap_index].ssid, - nw_info->ssid, nw_info->ssid_len); - memcpy(last_scanned_shadow[ap_index].bssid, - nw_info->bssid, ETH_ALEN); - last_scanned_shadow[ap_index].beacon_period = nw_info->beacon_period; - last_scanned_shadow[ap_index].dtim_period = nw_info->dtim_period; - last_scanned_shadow[ap_index].ch = nw_info->ch; - last_scanned_shadow[ap_index].ies_len = nw_info->ies_len; - last_scanned_shadow[ap_index].tsf_hi = nw_info->tsf_hi; + shadow_nw_info->rssi_history.full = true; + } + shadow_nw_info->rssi_history.index = rssi_index; + shadow_nw_info->rssi = nw_info->rssi; + shadow_nw_info->cap_info = nw_info->cap_info; + shadow_nw_info->ssid_len = nw_info->ssid_len; + memcpy(shadow_nw_info->ssid, nw_info->ssid, nw_info->ssid_len); + memcpy(shadow_nw_info->bssid, nw_info->bssid, ETH_ALEN); + shadow_nw_info->beacon_period = nw_info->beacon_period; + shadow_nw_info->dtim_period = nw_info->dtim_period; + shadow_nw_info->ch = nw_info->ch; + shadow_nw_info->ies_len = nw_info->ies_len; + shadow_nw_info->tsf_hi = nw_info->tsf_hi; if (ap_found != -1) - kfree(last_scanned_shadow[ap_index].ies); - last_scanned_shadow[ap_index].ies = kmalloc(nw_info->ies_len, - GFP_KERNEL); - memcpy(last_scanned_shadow[ap_index].ies, - nw_info->ies, nw_info->ies_len); - last_scanned_shadow[ap_index].time_scan = jiffies; - last_scanned_shadow[ap_index].time_scan_cached = jiffies; - last_scanned_shadow[ap_index].found = 1; + kfree(shadow_nw_info->ies); + shadow_nw_info->ies = kmalloc(nw_info->ies_len, GFP_KERNEL); + memcpy(shadow_nw_info->ies, nw_info->ies, nw_info->ies_len); + shadow_nw_info->time_scan = jiffies; + shadow_nw_info->time_scan_cached = jiffies; + shadow_nw_info->found = 1; if (ap_found != -1) - kfree(last_scanned_shadow[ap_index].join_params); - last_scanned_shadow[ap_index].join_params = join_params; + kfree(shadow_nw_info->join_params); + shadow_nw_info->join_params = join_params; } static void cfg_scan_result(enum scan_event scan_event, |