Commit 73a75364 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: remove inner {} in wilc_parse_network_info()

Cleanup patch to remove the unnecessary {/**/} block in
wilc_parse_network_info().
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9bb28936
...@@ -274,6 +274,14 @@ s32 wilc_parse_network_info(u8 *msg_buffer, ...@@ -274,6 +274,14 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
u8 msg_type = 0; u8 msg_type = 0;
u16 wid_len = 0; u16 wid_len = 0;
u8 *wid_val = NULL; u8 *wid_val = NULL;
u8 *msa = NULL;
u16 rx_len = 0;
u8 *tim_elm = NULL;
u8 *ies = NULL;
u16 ies_len = 0;
u8 index = 0;
u32 tsf_lo;
u32 tsf_hi;
msg_type = msg_buffer[0]; msg_type = msg_buffer[0];
...@@ -283,60 +291,49 @@ s32 wilc_parse_network_info(u8 *msg_buffer, ...@@ -283,60 +291,49 @@ s32 wilc_parse_network_info(u8 *msg_buffer,
wid_len = MAKE_WORD16(msg_buffer[6], msg_buffer[7]); wid_len = MAKE_WORD16(msg_buffer[6], msg_buffer[7]);
wid_val = &msg_buffer[8]; wid_val = &msg_buffer[8];
{ network_info = kzalloc(sizeof(*network_info), GFP_KERNEL);
u8 *msa = NULL; if (!network_info)
u16 rx_len = 0; return -ENOMEM;
u8 *tim_elm = NULL;
u8 *ies = NULL;
u16 ies_len = 0;
u8 index = 0;
u32 tsf_lo;
u32 tsf_hi;
network_info = kzalloc(sizeof(*network_info), GFP_KERNEL);
if (!network_info)
return -ENOMEM;
network_info->rssi = wid_val[0]; network_info->rssi = wid_val[0];
msa = &wid_val[1]; msa = &wid_val[1];
rx_len = wid_len - 1; rx_len = wid_len - 1;
network_info->cap_info = get_cap_info(msa); network_info->cap_info = get_cap_info(msa);
network_info->tsf_lo = get_beacon_timestamp_lo(msa); network_info->tsf_lo = get_beacon_timestamp_lo(msa);
tsf_lo = get_beacon_timestamp_lo(msa); tsf_lo = get_beacon_timestamp_lo(msa);
tsf_hi = get_beacon_timestamp_hi(msa); tsf_hi = get_beacon_timestamp_hi(msa);
network_info->tsf_hi = tsf_lo | ((u64)tsf_hi << 32); network_info->tsf_hi = tsf_lo | ((u64)tsf_hi << 32);
get_ssid(msa, network_info->ssid, &network_info->ssid_len); get_ssid(msa, network_info->ssid, &network_info->ssid_len);
get_BSSID(msa, network_info->bssid); get_BSSID(msa, network_info->bssid);
network_info->ch = get_current_channel_802_11n(msa, rx_len network_info->ch = get_current_channel_802_11n(msa, rx_len
+ FCS_LEN); + FCS_LEN);
index = MAC_HDR_LEN + TIME_STAMP_LEN; index = MAC_HDR_LEN + TIME_STAMP_LEN;
network_info->beacon_period = get_beacon_period(msa + index); network_info->beacon_period = get_beacon_period(msa + index);
index += BEACON_INTERVAL_LEN + CAP_INFO_LEN; index += BEACON_INTERVAL_LEN + CAP_INFO_LEN;
tim_elm = get_tim_elm(msa, rx_len + FCS_LEN, index); tim_elm = get_tim_elm(msa, rx_len + FCS_LEN, index);
if (tim_elm) if (tim_elm)
network_info->dtim_period = tim_elm[3]; network_info->dtim_period = tim_elm[3];
ies = &msa[TAG_PARAM_OFFSET]; ies = &msa[TAG_PARAM_OFFSET];
ies_len = rx_len - TAG_PARAM_OFFSET; ies_len = rx_len - TAG_PARAM_OFFSET;
if (ies_len > 0) { if (ies_len > 0) {
network_info->ies = kmemdup(ies, ies_len, GFP_KERNEL); network_info->ies = kmemdup(ies, ies_len, GFP_KERNEL);
if (!network_info->ies) { if (!network_info->ies) {
kfree(network_info); kfree(network_info);
return -ENOMEM; return -ENOMEM;
}
} }
network_info->ies_len = ies_len;
} }
network_info->ies_len = ies_len;
*ret_network_info = network_info; *ret_network_info = network_info;
......
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