staging: rtl8192e: Remove checks of pointer to stop_send.. and rtllib_..
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sat, 25 Feb 2023 18:20:41 +0000 (19:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Mar 2023 16:05:47 +0000 (17:05 +0100)
Function pointers of stop_send_beacons and rtllib_ips_leave_wq 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/f12e9167499344059f77991d2058c050bbe744d2.1677345331.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_softmac.c

index b06baf5ff6d49e8e72877346dc5be3f06661b1d9..7b73c5df5e2a56429699e608c7e8d967d0dde5ad 100644 (file)
@@ -659,8 +659,7 @@ static void rtllib_beacons_stop(struct rtllib_device *ieee)
 
 void rtllib_stop_send_beacons(struct rtllib_device *ieee)
 {
-       if (ieee->stop_send_beacons)
-               ieee->stop_send_beacons(ieee->dev);
+       ieee->stop_send_beacons(ieee->dev);
        if (ieee->softmac_features & IEEE_SOFTMAC_BEACONS)
                rtllib_beacons_stop(ieee);
 }
@@ -728,8 +727,7 @@ EXPORT_SYMBOL(rtllib_act_scanning);
 /* called with ieee->lock held */
 static void rtllib_start_scan(struct rtllib_device *ieee)
 {
-       if (ieee->rtllib_ips_leave_wq != NULL)
-               ieee->rtllib_ips_leave_wq(ieee->dev);
+       ieee->rtllib_ips_leave_wq(ieee->dev);
 
        if (IS_DOT11D_ENABLE(ieee)) {
                if (IS_COUNTRY_IE_VALID(ieee))
@@ -1584,8 +1582,7 @@ static void rtllib_associate_procedure_wq(void *data)
        rtllib_stop_scan(ieee);
        HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
        if (ieee->rf_power_state == rf_off) {
-               if (ieee->rtllib_ips_leave_wq != NULL)
-                       ieee->rtllib_ips_leave_wq(ieee->dev);
+               ieee->rtllib_ips_leave_wq(ieee->dev);
                mutex_unlock(&ieee->wx_mutex);
                return;
        }