summaryrefslogtreecommitdiffstats
path: root/drivers/staging/r8188eu/os_dep/ioctl_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/r8188eu/os_dep/ioctl_linux.c')
-rw-r--r--drivers/staging/r8188eu/os_dep/ioctl_linux.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index 2de2e1e32738..8e9b7b0664bc 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -1011,7 +1011,6 @@ static int rtw_wx_set_mlme(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- int ret = 0;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct iw_mlme *mlme = (struct iw_mlme *)extra;
@@ -1020,17 +1019,15 @@ static int rtw_wx_set_mlme(struct net_device *dev,
switch (mlme->cmd) {
case IW_MLME_DEAUTH:
- if (!rtw_set_802_11_disassociate(padapter))
- ret = -1;
+ rtw_set_802_11_disassociate(padapter);
break;
case IW_MLME_DISASSOC:
- if (!rtw_set_802_11_disassociate(padapter))
- ret = -1;
+ rtw_set_802_11_disassociate(padapter);
break;
default:
return -EOPNOTSUPP;
}
- return ret;
+ return 0;
}
static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
@@ -1340,7 +1337,7 @@ static int rtw_wx_set_rate(struct net_device *dev,
struct iw_request_info *a,
union iwreq_data *wrqu, char *extra)
{
- int i, ret = 0;
+ int i;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
u8 datarates[NumRates];
u32 target_rate = wrqu->bitrate.value;
@@ -1408,10 +1405,7 @@ set_rate:
}
}
- if (rtw_setdatarate_cmd(padapter, datarates) != _SUCCESS)
- ret = -1;
-
- return ret;
+ return rtw_setdatarate_cmd(padapter, datarates);
}
static int rtw_wx_get_rate(struct net_device *dev,
@@ -2647,7 +2641,7 @@ static int rtw_p2p_connect(struct net_device *dev,
u32 peer_channel = 0;
/* Commented by Albert 20110304 */
- /* The input data contains two informations. */
+ /* The input data contains two information. */
/* 1. First information is the MAC address which wants to formate with */
/* 2. Second information is the WPS PINCode or "pbc" string for push button method */
/* Format: 00:E0:4C:00:00:05 */
@@ -2721,7 +2715,7 @@ static void rtw_p2p_invite_req(struct net_device *dev,
uint p2pielen = 0, attr_contentlen = 0;
struct tx_invite_req_info *pinvite_req_info = &pwdinfo->invitereq_info;
- /* The input data contains two informations. */
+ /* The input data contains two information items. */
/* 1. First information is the P2P device address which you want to send to. */
/* 2. Second information is the group id which combines with GO's mac address, space and GO's ssid. */
/* Command line sample: iwpriv wlan0 p2p_set invite ="00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy" */
@@ -2845,7 +2839,7 @@ static void rtw_p2p_prov_disc(struct net_device *dev,
u8 *p2pie;
uint p2pielen = 0, attr_contentlen = 0;
- /* The input data contains two informations. */
+ /* The input data contains two information items. */
/* 1. First information is the MAC address which wants to issue the provisioning discovery request frame. */
/* 2. Second information is the WPS configuration method which wants to discovery */
/* Format: 00:E0:4C:00:00:05_display */
@@ -2979,8 +2973,6 @@ static int rtw_p2p_set(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- int ret = 0;
-
if (!memcmp(extra, "enable =", 7)) {
rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]);
} else if (!memcmp(extra, "setDN =", 6)) {
@@ -3027,7 +3019,7 @@ static int rtw_p2p_set(struct net_device *dev,
rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]);
}
- return ret;
+ return 0;
}
static int rtw_p2p_get2(struct net_device *dev,
@@ -3568,7 +3560,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
(!memcmp(&probereq_wpsie[2], wps_oui, 4))) {
- cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len;
+ cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN);
pmlmepriv->wps_probe_req_ie_len = 0;
kfree(pmlmepriv->wps_probe_req_ie);