diff options
author | Nishka Dasgupta <nishkadg.linux@gmail.com> | 2019-07-22 14:53:39 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-25 09:52:00 +0200 |
commit | 34ef8dbe02f403b03999ccefd489ca3a7a5e08f1 (patch) | |
tree | 1c2a39f612ab109e4740f47c7e76a4438d6fdcb4 /drivers/staging/rtl8712/rtl871x_ioctl_linux.c | |
parent | staging: rtl8712: init_mp_priv(): Change return values (diff) | |
download | linux-dev-34ef8dbe02f403b03999ccefd489ca3a7a5e08f1.tar.xz linux-dev-34ef8dbe02f403b03999ccefd489ca3a7a5e08f1.zip |
staging: rtl8712: r8712_set_802_11_add_wep(): Change return values
Change call sites of r8712_set_802_11_add_wep to check for 0 and
non-zero values (e.g -EINVAL, -ENOMEM) instead of for _SUCCESS and
_FAIL.
Change return values of r8712_set_802_11_add_wep from true and false and
_SUCCESS to -EINVAL and the return value of r8712_set_key.
Change return type from u8 to int to accommodate these new return
values.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-6-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_ioctl_linux.c')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index b08b9a191a34..944336e0d2e2 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -419,8 +419,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, pwep->KeyIndex |= 0x80000000; memcpy(pwep->KeyMaterial, param->u.crypt.key, pwep->KeyLength); if (param->u.crypt.set_tx) { - if (r8712_set_802_11_add_wep(padapter, pwep) == - (u8)_FAIL) + if (r8712_set_802_11_add_wep(padapter, pwep)) ret = -EOPNOTSUPP; } else { /* don't update "psecuritypriv->PrivacyAlgrthm" and @@ -1585,7 +1584,7 @@ static int r8711_wx_set_enc(struct net_device *dev, } wep.KeyIndex |= 0x80000000; /* transmit key */ memcpy(wep.KeyMaterial, keybuf, wep.KeyLength); - if (r8712_set_802_11_add_wep(padapter, &wep) == _FAIL) + if (r8712_set_802_11_add_wep(padapter, &wep)) return -EOPNOTSUPP; return 0; } |