staging: rtl8192e: Remove checks of pointer to rtllib.. and ScanOpera..
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sat, 25 Feb 2023 18:20:50 +0000 (19:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Mar 2023 16:05:47 +0000 (17:05 +0100)
Function pointers of rtllib_ips_leave and ScanOperationBackupHandler is
set while executing the probe function. Therefore a NULL pointer check is
not required. Remove checks as it is dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/8b01cbfaad2db4666b98bfeae29dd429d8c6cd07.1677345331.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
drivers/staging/rtl8192e/rtllib_softmac.c
drivers/staging/rtl8192e/rtllib_softmac_wx.c

index 718d69b4ce16613b330a3298b9d6fd456e931f5a..47feb4248d251f7206eca09362f6ddd62205e441 100644 (file)
@@ -703,8 +703,7 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf)
        if (priv->up == 0)
                return -1;
 
-       if (priv->rtllib->rtllib_ips_leave)
-               priv->rtllib->rtllib_ips_leave(dev);
+       priv->rtllib->rtllib_ips_leave(dev);
 
        if (priv->rtllib->state == RTLLIB_LINKED)
                rtl92e_leisure_ps_leave(dev);
index bf0030144e5d8c590b214276087e37798181f95b..cb28288a618b99457c3e9d8971a9e46187a630dc 100644 (file)
@@ -432,15 +432,11 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
                if (priv->rtllib->rf_power_state != rf_off) {
                        priv->rtllib->actscanning = true;
 
-                       if (ieee->ScanOperationBackupHandler)
-                               ieee->ScanOperationBackupHandler(ieee->dev,
-                                                        SCAN_OPT_BACKUP);
+                       ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP);
 
                        rtllib_start_scan_syncro(priv->rtllib, 0);
 
-                       if (ieee->ScanOperationBackupHandler)
-                               ieee->ScanOperationBackupHandler(ieee->dev,
-                                                        SCAN_OPT_RESTORE);
+                       ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE);
                }
                ret = 0;
        } else {
index 7b73c5df5e2a56429699e608c7e8d967d0dde5ad..4923423aa85bab6e4a19a82640c0e8dc46c01e5d 100644 (file)
@@ -1572,8 +1572,7 @@ static void rtllib_associate_procedure_wq(void *data)
                                     struct rtllib_device,
                                     associate_procedure_wq);
        rtllib_stop_scan_syncro(ieee);
-       if (ieee->rtllib_ips_leave != NULL)
-               ieee->rtllib_ips_leave(ieee->dev);
+       ieee->rtllib_ips_leave(ieee->dev);
        mutex_lock(&ieee->wx_mutex);
 
        if (ieee->data_hard_stop)
@@ -2850,8 +2849,7 @@ void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown)
        if (shutdown) {
                ieee->proto_started = 0;
                ieee->proto_stoppping = 1;
-               if (ieee->rtllib_ips_leave != NULL)
-                       ieee->rtllib_ips_leave(ieee->dev);
+               ieee->rtllib_ips_leave(ieee->dev);
        }
 
        rtllib_stop_send_beacons(ieee);
index f90764d1d9ab6ee4ca72825e544a34e1d2cdc3f2..06f1d6de5cc758c10daffefc2780e59829829cd1 100644 (file)
@@ -355,8 +355,7 @@ void rtllib_wx_sync_scan_wq(void *data)
        /* wait for ps packet to be kicked out successfully */
        msleep(50);
 
-       if (ieee->ScanOperationBackupHandler)
-               ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP);
+       ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP);
 
        if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht &&
            ieee->ht_info->bCurBW40MHz) {
@@ -381,8 +380,7 @@ void rtllib_wx_sync_scan_wq(void *data)
                ieee->set_chan(ieee->dev, chan);
        }
 
-       if (ieee->ScanOperationBackupHandler)
-               ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE);
+       ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE);
 
        ieee->state = RTLLIB_LINKED;
        ieee->link_change(ieee->dev);