diff options
Diffstat (limited to 'drivers/staging/rtl8192e/rtllib_softmac_wx.c')
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac_wx.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index 9715a79..86f52ac 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -160,7 +160,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee, if (is_zero_ether_addr(temp->sa_data)) { spin_lock_irqsave(&ieee->lock, flags); - memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN); + ether_addr_copy(ieee->current_network.bssid, temp->sa_data); ieee->wap_set = 0; spin_unlock_irqrestore(&ieee->lock, flags); ret = -1; @@ -177,7 +177,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee, spin_lock_irqsave(&ieee->lock, flags); ieee->cannot_notify = false; - memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN); + ether_addr_copy(ieee->current_network.bssid, temp->sa_data); ieee->wap_set = !is_zero_ether_addr(temp->sa_data); spin_unlock_irqrestore(&ieee->lock, flags); @@ -454,13 +454,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, proto_started = ieee->proto_started; - len = (wrqu->essid.length < IW_ESSID_MAX_SIZE) ? wrqu->essid.length : - IW_ESSID_MAX_SIZE; - - if (len > IW_ESSID_MAX_SIZE) { - ret = -E2BIG; - goto out; - } + len = min_t(__u16, wrqu->essid.length, IW_ESSID_MAX_SIZE); if (ieee->iw_mode == IW_MODE_MONITOR) { ret = -1; @@ -575,9 +569,9 @@ int rtllib_wx_set_power(struct rtllib_device *ieee, if ((!ieee->sta_wake_up) || (!ieee->enter_sleep_state) || (!ieee->ps_is_queue_empty)) { - RTLLIB_DEBUG(RTLLIB_DL_ERR, - "%s(): PS mode is tried to be use but driver missed a callback\n\n", - __func__); + netdev_warn(ieee->dev, + "%s(): PS mode is tried to be use but driver missed a callback\n", + __func__); return -1; } |