]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
staging: wilc1000: fix line over 80 chars in add_network_to_shadow()
authorAjay Singh <ajay.kathat@microchip.com>
Fri, 11 May 2018 08:13:14 +0000 (13:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 May 2018 12:04:48 +0000 (14:04 +0200)
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>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index 9afba4d8945fa68a6bf39cd006ddc2e950c44b22..c730323cab8723ee5fa11275c93a64e3b19c5c7c 100644 (file)
@@ -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,