staging: r8188eu: change return type of rtw_set_802_11_disassociate to void
authorPhillip Potter <phil@philpotter.co.uk>
Thu, 3 Nov 2022 23:06:32 +0000 (23:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Nov 2022 15:26:34 +0000 (16:26 +0100)
Change return type of rtw_set_802_11_disassociate to void. This function
always returns 'true' no matter what, so there is no need to return a
value, and no need to check for it in the two call sites within
rtw_wx_set_mlme. Also, as we are no longer using ret in rtw_wx_set_mlme
except as the return value, just remove it and return 0 directly.

Suggested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20221103230632.6946-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_ioctl_set.c
drivers/staging/r8188eu/include/rtw_ioctl_set.h
drivers/staging/r8188eu/os_dep/ioctl_linux.c

index 7864318266598e83cd80acb31c42f95c7f988ff9..785c0dba508fae27dc152078ca5a3a39e3dc3e36 100644 (file)
@@ -314,7 +314,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
        return true;
 }
 
-u8 rtw_set_802_11_disassociate(struct adapter *padapter)
+void rtw_set_802_11_disassociate(struct adapter *padapter)
 {
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
@@ -328,8 +328,6 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter)
        }
 
        spin_unlock_bh(&pmlmepriv->lock);
-
-       return true;
 }
 
 u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
index abe460d6504d091ffb7bb0ae5cb325cab2b9d0e6..c3eb2479f27b49613a53782df2c3aed3e7813c96 100644 (file)
@@ -12,7 +12,7 @@ u8 rtw_set_802_11_authentication_mode(struct adapter *adapt,
                                      enum ndis_802_11_auth_mode authmode);
 u8 rtw_set_802_11_bssid(struct adapter *adapter, u8 *bssid);
 u8 rtw_set_802_11_add_wep(struct adapter *adapter, struct ndis_802_11_wep *wep);
-u8 rtw_set_802_11_disassociate(struct adapter *adapter);
+void rtw_set_802_11_disassociate(struct adapter *adapter);
 u8 rtw_set_802_11_bssid_list_scan(struct adapter *adapter,
                                  struct ndis_802_11_ssid *pssid,
                                  int ssid_max_num);
index dda48a2a6d0c1d97b3325b55027523bb0eeddc59..8e9b7b0664bc31577e93e0812107c5b09b098888 100644 (file)
@@ -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,