list_for_each(ptr, &priv->pmklist.head) {
pmk = list_entry(ptr, struct pmk_t, list);
if (!memcmp(pmksa->bssid.sa_data, pmk->bssid, ETH_ALEN)) { /* match address! list move to head. */
- memcpy(pmk->pmkid, pmksa->pmkid,
- IW_PMKID_LEN);
- list_move(&pmk->list,
- &priv->pmklist.head);
+ memcpy(pmk->pmkid, pmksa->pmkid, IW_PMKID_LEN);
+ list_move(&pmk->list, &priv->pmklist.head);
break; /* list_for_each */
}
}
if (priv->pmklist.size <= PMK_LIST_MAX) { /* new cache data */
for (i = 0; i < PMK_LIST_MAX; i++) {
pmk = &priv->pmklist.pmk[i];
- if (!memcmp
- ("\x00\x00\x00\x00\x00\x00",
- pmk->bssid, ETH_ALEN))
- break;
+ if (!memcmp("\x00\x00\x00\x00\x00\x00",
+ pmk->bssid, ETH_ALEN))
+ break; /* loop */
}
- memcpy(pmk->bssid, pmksa->bssid.sa_data,
- ETH_ALEN);
- memcpy(pmk->pmkid, pmksa->pmkid,
- IW_PMKID_LEN);
- list_add(&pmk->list,
- &priv->pmklist.head);
+ memcpy(pmk->bssid, pmksa->bssid.sa_data, ETH_ALEN);
+ memcpy(pmk->pmkid, pmksa->pmkid, IW_PMKID_LEN);
+ list_add(&pmk->list, &priv->pmklist.head);
priv->pmklist.size++;
} else { /* overwrite old cache data */
- pmk =
- list_entry(priv->pmklist.head.prev,
- struct pmk_t, list);
- memcpy(pmk->bssid, pmksa->bssid.sa_data,
- ETH_ALEN);
- memcpy(pmk->pmkid, pmksa->pmkid,
- IW_PMKID_LEN);
- list_move(&pmk->list,
- &priv->pmklist.head);
+ pmk = list_entry(priv->pmklist.head.prev, struct pmk_t,
+ list);
+ memcpy(pmk->bssid, pmksa->bssid.sa_data, ETH_ALEN);
+ memcpy(pmk->pmkid, pmksa->pmkid, IW_PMKID_LEN);
+ list_move(&pmk->list, &priv->pmklist.head);
}
break;
case IW_PMKSA_REMOVE: