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

staging: wilc1000: remove unnecessary always true 'if' conditions

Remove the unnecessary always true 'if' conditions and simiplifed the
logic as suggested in [1].

[1]. https://lore.kernel.org/linux-wireless/20200302092346.GA24308@kadam/Suggested-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20200302162226.4196-3-ajay.kathat@microchip.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent efabc44b
......@@ -888,7 +888,6 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,
struct cfg80211_pmksa *pmksa)
{
u32 i;
int ret = 0;
struct wilc_vif *vif = netdev_priv(netdev);
struct wilc_priv *priv = &vif->priv;
......@@ -901,21 +900,20 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,
}
}
if (i < priv->pmkid_list.numpmkid && priv->pmkid_list.numpmkid > 0) {
for (; i < (priv->pmkid_list.numpmkid - 1); i++) {
memcpy(priv->pmkid_list.pmkidlist[i].bssid,
priv->pmkid_list.pmkidlist[i + 1].bssid,
ETH_ALEN);
memcpy(priv->pmkid_list.pmkidlist[i].pmkid,
priv->pmkid_list.pmkidlist[i + 1].pmkid,
WLAN_PMKID_LEN);
}
priv->pmkid_list.numpmkid--;
} else {
ret = -EINVAL;
if (i == priv->pmkid_list.numpmkid)
return -EINVAL;
for (; i < (priv->pmkid_list.numpmkid - 1); i++) {
memcpy(priv->pmkid_list.pmkidlist[i].bssid,
priv->pmkid_list.pmkidlist[i + 1].bssid,
ETH_ALEN);
memcpy(priv->pmkid_list.pmkidlist[i].pmkid,
priv->pmkid_list.pmkidlist[i + 1].pmkid,
WLAN_PMKID_LEN);
}
priv->pmkid_list.numpmkid--;
return ret;
return 0;
}
static int flush_pmksa(struct wiphy *wiphy, struct net_device *netdev)
......
......@@ -703,10 +703,8 @@ static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size)
wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len);
} else {
if (!is_cfg_packet) {
if (pkt_len > 0) {
wilc_frmw_to_host(wilc, buff_ptr,
pkt_len, pkt_offset);
}
wilc_frmw_to_host(wilc, buff_ptr, pkt_len,
pkt_offset);
} else {
struct wilc_cfg_rsp rsp;
......
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