Commit c9f90681 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: ks7010: refactor hostif_sme_set_pmksa function

This commits refactor a bit hostif_sme_set_pmksa function:
 - avoid one level indentation changing if condition.
 - use ether_addr_copy to copy bssid addresses.
 - move 'i' initialization to declaration place.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent be4e1341
......@@ -2059,17 +2059,15 @@ void hostif_sme_set_pmksa(struct ks_wlan_private *priv)
} __packed list[PMK_LIST_MAX];
} __packed pmkcache;
struct pmk *pmk;
int i;
int i = 0;
i = 0;
list_for_each_entry(pmk, &priv->pmklist.head, list) {
if (i < PMK_LIST_MAX) {
memcpy(pmkcache.list[i].bssid, pmk->bssid, ETH_ALEN);
memcpy(pmkcache.list[i].pmkid, pmk->pmkid,
IW_PMKID_LEN);
if (i >= PMK_LIST_MAX)
break;
ether_addr_copy(pmkcache.list[i].bssid, pmk->bssid);
memcpy(pmkcache.list[i].pmkid, pmk->pmkid, IW_PMKID_LEN);
i++;
}
}
pmkcache.size = cpu_to_le16((uint16_t)(priv->pmklist.size));
hostif_mib_set_request(priv, LOCAL_PMK,
sizeof(priv->pmklist.size) + (ETH_ALEN +
......
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