diff options
Diffstat (limited to 'drivers/staging/rtl8723au/os_dep')
-rw-r--r-- | drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 43 | ||||
-rw-r--r-- | drivers/staging/rtl8723au/os_dep/usb_ops_linux.c | 9 | ||||
-rw-r--r-- | drivers/staging/rtl8723au/os_dep/xmit_linux.c | 2 |
3 files changed, 20 insertions, 34 deletions
diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 0ae2180a3..12d18440e 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -458,7 +458,7 @@ static int set_group_key(struct rtw_adapter *padapter, struct key_params *parms, pcmd->cmdcode = _SetKey_CMD_; pcmd->parmbuf = (u8 *) psetkeyparm; - pcmd->cmdsz = (sizeof(struct setkey_parm)); + pcmd->cmdsz = sizeof(struct setkey_parm); pcmd->rsp = NULL; pcmd->rspsz = 0; @@ -543,7 +543,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, memcpy(psecuritypriv-> dot118021XGrpKey[key_index].skey, keyparms->key, - (key_len > 16 ? 16 : key_len)); + (min(16, key_len))); /* set mic key */ memcpy(psecuritypriv-> @@ -565,7 +565,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, memcpy(psecuritypriv-> dot118021XGrpKey[key_index].skey, keyparms->key, - (key_len > 16 ? 16 : key_len)); + (min(16, key_len))); } else { DBG_8723A("%s, set group_key, none\n", __func__); @@ -603,7 +603,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, if (set_tx == 1) { /* pairwise key */ memcpy(psta->dot118021x_UncstKey.skey, - keyparms->key, (key_len > 16 ? 16 : key_len)); + keyparms->key, (min(16, key_len))); if (keyparms->cipher == WLAN_CIPHER_SUITE_WEP40 || keyparms->cipher == WLAN_CIPHER_SUITE_WEP104) { @@ -661,7 +661,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, memcpy(psecuritypriv-> dot118021XGrpKey[key_index].skey, keyparms->key, - (key_len > 16 ? 16 : key_len)); + (min(16, key_len))); /* set mic key */ memcpy(psecuritypriv-> @@ -679,7 +679,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, u8 key_index, memcpy(psecuritypriv-> dot118021XGrpKey[key_index].skey, keyparms->key, - (key_len > 16 ? 16 : key_len)); + (min(16, key_len))); } else { psecuritypriv->dot118021XGrpPrivacy = 0; } @@ -789,7 +789,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, memcpy(psta->dot118021x_UncstKey.skey, keyparms->key, - (key_len > 16 ? 16 : key_len)); + (min(16, key_len))); if (keyparms->cipher == WLAN_CIPHER_SUITE_TKIP) { @@ -812,7 +812,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, u8 key_index, memcpy(padapter->securitypriv. dot118021XGrpKey[key_index].skey, keyparms->key, - (key_len > 16 ? 16 : key_len)); + (min(16, key_len))); memcpy(padapter->securitypriv. dot118021XGrptxmickey[key_index]. skey, &keyparms->key[16], 8); @@ -1270,18 +1270,14 @@ void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv, void rtw_cfg80211_surveydone_event_callback(struct rtw_adapter *padapter) { - struct list_head *plist, *phead, *ptmp; + struct list_head *phead; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct rtw_queue *queue = &pmlmepriv->scanned_queue; - struct wlan_network *pnetwork; + struct wlan_network *pnetwork, *ptmp; spin_lock_bh(&pmlmepriv->scanned_queue.lock); - phead = get_list_head(queue); - - list_for_each_safe(plist, ptmp, phead) { - pnetwork = container_of(plist, struct wlan_network, list); - + list_for_each_entry_safe(pnetwork, ptmp, phead, list) { /* report network only if the current channel set contains the channel to which this network belongs */ if (rtw_ch_set_search_ch23a @@ -1289,7 +1285,6 @@ void rtw_cfg80211_surveydone_event_callback(struct rtw_adapter *padapter) pnetwork->network.DSConfig) >= 0) rtw_cfg80211_inform_bss(padapter, pnetwork); } - spin_unlock_bh(&pmlmepriv->scanned_queue.lock); /* call this after other things have been done */ @@ -2202,7 +2197,7 @@ static int cfg80211_rtw_get_txpower(struct wiphy *wiphy, struct wireless_dev *wdev, int *dbm) { DBG_8723A("%s\n", __func__); - *dbm = (12); + *dbm = 12; return 0; } @@ -2615,8 +2610,6 @@ static int rtw_cfg80211_add_monitor_if(struct rtw_adapter *padapter, char *name, /* wdev */ mon_wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); if (!mon_wdev) { - DBG_8723A("%s(%s): allocate mon_wdev fail\n", __func__, - padapter->pnetdev->name); ret = -ENOMEM; goto out; } @@ -2850,9 +2843,9 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, { const u8 *mac = params->mac; int ret = 0; - struct list_head *phead, *plist, *ptmp; + struct list_head *phead; u8 updated = 0; - struct sta_info *psta; + struct sta_info *psta, *ptmp; struct rtw_adapter *padapter = netdev_priv(ndev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct sta_priv *pstapriv = &padapter->stapriv; @@ -2881,13 +2874,9 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, return -EINVAL; spin_lock_bh(&pstapriv->asoc_list_lock); - phead = &pstapriv->asoc_list; - /* check asoc_queue */ - list_for_each_safe(plist, ptmp, phead) { - psta = container_of(plist, struct sta_info, asoc_list); - + list_for_each_entry_safe(psta, ptmp, phead, asoc_list) { if (ether_addr_equal(mac, psta->hwaddr)) { if (psta->dot8021xalg == 1 && psta->bpairwise_key_installed == false) { @@ -2912,7 +2901,6 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, } } } - spin_unlock_bh(&pstapriv->asoc_list_lock); associated_clients_update23a(padapter, updated); @@ -3272,7 +3260,6 @@ int rtw_wdev_alloc(struct rtw_adapter *padapter, struct device *dev) /* wdev */ wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); if (!wdev) { - DBG_8723A("Couldn't allocate wireless device\n"); ret = -ENOMEM; goto free_wiphy; } diff --git a/drivers/staging/rtl8723au/os_dep/usb_ops_linux.c b/drivers/staging/rtl8723au/os_dep/usb_ops_linux.c index 0cdaef0a8..cf4a50618 100644 --- a/drivers/staging/rtl8723au/os_dep/usb_ops_linux.c +++ b/drivers/staging/rtl8723au/os_dep/usb_ops_linux.c @@ -210,22 +210,21 @@ exit: void rtl8723au_write_port_cancel(struct rtw_adapter *padapter) { struct xmit_buf *pxmitbuf; - struct list_head *plist; int j; DBG_8723A("%s\n", __func__); padapter->bWritePortCancel = true; - list_for_each(plist, &padapter->xmitpriv.xmitbuf_list) { - pxmitbuf = container_of(plist, struct xmit_buf, list2); + list_for_each_entry(pxmitbuf, &padapter->xmitpriv.xmitbuf_list, + list2) { for (j = 0; j < 8; j++) { if (pxmitbuf->pxmit_urb[j]) usb_kill_urb(pxmitbuf->pxmit_urb[j]); } } - list_for_each(plist, &padapter->xmitpriv.xmitextbuf_list) { - pxmitbuf = container_of(plist, struct xmit_buf, list2); + list_for_each_entry(pxmitbuf, &padapter->xmitpriv.xmitextbuf_list, + list2) { for (j = 0; j < 8; j++) { if (pxmitbuf->pxmit_urb[j]) usb_kill_urb(pxmitbuf->pxmit_urb[j]); diff --git a/drivers/staging/rtl8723au/os_dep/xmit_linux.c b/drivers/staging/rtl8723au/os_dep/xmit_linux.c index 9a14074ec..64be72ac3 100644 --- a/drivers/staging/rtl8723au/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8723au/os_dep/xmit_linux.c @@ -37,7 +37,7 @@ int rtw_os_xmit_resource_alloc23a(struct rtw_adapter *padapter, for (i = 0; i < 8; i++) { pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL); - if (pxmitbuf->pxmit_urb[i] == NULL) { + if (!pxmitbuf->pxmit_urb[i]) { DBG_8723A("pxmitbuf->pxmit_urb[i]==NULL"); return _FAIL; } |